How to display japanese Kanji inside a cmd window under windows?

Viewed 40678

I have an english Windows 2003 server with asiatic language support activated. The two only fonts available for the command window (cmd settings) are raster and lucida console. Neither the one nor the other display the Kanji correctly (displayed as question mark).

Is there a solution to get them displayed? Is there some transformation I must do in my application before writing out to the console?

I am writing UTF8 out at the moment, what works well also for some non ASCII characters (like öäüß). The source code writing to the console has the correct data (the Kanji can be viewed in the debugger correctly). If it matters, I am writing the app in C#.

EDIT: I found this link which explains the issues behind the problem and presents a solution (involving native calls) for C#. This shall work well with .NET 4.5 (untested by me)

4 Answers

Consolas (even on Windows 10) does not display Japanese characters correctly in a console; I checked the font in Character Map and it simply doesn't have glyphs for any SE Asian languages. You need to set your console font to MS Mincho or a similar Asian-supporting font to show Japanese characters. This will also change backslashes to yen symbols which is a standard thing on Japanese systems. You don't need to change your code page or locale settings, but you will need to at least install Japanese language support to get the Japanese fonts installed. On NT5 systems like Windows Server 2003 and Windows XP, there's a checkbox somewhere in the regional and language options for it; on NT6 (Vista and later) you can just add the Japanese IME and it'll install the required files.

Related