views:

424

answers:

1

Hello,

I have a Japanese final coming up soon, so to help me study I made a program to help me study. But, I can't seem to get VS2008 to display any Unicode in the Console. This is a sample I used to see if I could display Unicode:

    string diancai = new string(new char[]{ '\u70B9','\u83DC' });

    Console.Write(diancai[0] + " " + diancai[1]);

Output is:

    ? ?

Please help! Thank you!

+2  A: 

Go to your command prompt and try a command "chcp"

It should be like this

C:\> chcp
現在のコード ページ: 932

932 is japanese, If code page is not correct or if your windows does not support, It can't display it in console.

I can run yours in mine, its display following chars, mine is japanese windows.

点 菜

So, For your case, I recommand you to try with GUI program instead of console

S.Mark
I did it and this was the result: C:\> chcp Active code page: 437Any chance I can change it to 932?
Hassaan M
Try `chcp 932`, and try copy paste "点 菜", if you can't see that, its mean you cannot do that. try with GUI.
S.Mark
OH I see...Umm this might be too much to ask, but can you please give me a sample code, showing me how to display characters using a GUI window? This is my first time programming in C# and my final is coming up soon.
Hassaan M
And I've been searching for an answer all day today with no luck.
Hassaan M
chcp 932 did not work, unfortunately.
Hassaan M
I prsume you're using an english version of Wondows? it doesn't work here either...
RCIX
Yeah, its mean, your windows doesnot support it, for GUI, In Visual C# windows, there is option for New Project for `C# Windows Applications`, So just go ahead and try it, I assumed you know C# Language itself.
S.Mark
hmm ok thanks...I'll mess around with it
Hassaan M
you're welcome!
S.Mark
so there is no way of using UTF8 in console? im trying with this word: "Đức" but it's not working
DucDigital