Jarrett Billingsley Wrote: > On Sat, Jun 27, 2009 at 5:53 AM, Sam Hu<samhudotsa...@gmail.com> wrote: > > In DMD2030 I just found that Chinese characters the like can not print > > properly into console. > > > > //Below code does not show output properly in windows console: > > void main() > > { > > wstring country="Öйú"; > > writefln(country); > > } > > > > > > > > Is this an OS issue or is there any way to reach the goal? > > It's an OS issue. Someone asks about this once every two weeks. You > have to set up cmd.exe to use Unicode. You have to change the fonts > to Lucida, I think, and use 'chcp 65001' before running your program.
Thanks so much for your help. Below is my try: 1.source(wrote in notepad.exe) module test; import std.stdio; import std.c.windows.windows; extern(Windows) {BOOL SetConsoleOutputCP(UINT wCodePageID);} void main() { SetConsoleOutputCP(65001); wstring country="Öйú"; writefln(country); } 2.set notepad font Lucida Console (acutally tried Lucida Sans Unicode also); 3.Save test.d in Unicode (actually also tried UTF-8); 4.Compile and run.But the output still doesn't make sense. Regards, Sam