如何在windows下的cmd窗口中显示日语汉字? [英] How to display japanese Kanji inside a cmd window under windows?

查看:1047
本文介绍了如何在windows下的cmd窗口中显示日语汉字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个启用了亚洲语言支持的英语Windows 2003服务器。命令窗口可用的两种字体(cmd设置)是raster和lucida控制台。一个或另一个没有正确显示汉字(显示为问号)。

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?

我现在正在写UTF8,对于一些非ASCII字符(例如öäüß)也有效。写入控制台的源代码具有正确的数据(汉字可以在调试器中正确查看)。如果重要,我在C#中编写应用程序。

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#.

编辑:
我发现这个链接,解释问题背后的问题并提出解决方案(涉及本地调用)for C#。这将适用于.NET 4.5(未经我测试)

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)

推荐答案

如果您发现一个字体将显示汉字字符集,您可以通过在此注册表项下添加值,将该字体添加到cmd设置:

If you find a font that will display the Kanji character set, you can add that font to the cmd Settings by adding values under this Registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont\

值:

Name: 00
Data: Consolas

我之前做过,但在SuperUser上找到了这个参考: http://superuser.com/q/55318

I've done this before but found this reference on SuperUser: http://superuser.com/q/55318

希望这有助于

这篇关于如何在windows下的cmd窗口中显示日语汉字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆