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

查看:34
本文介绍了如何在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#.

我找到了这个链接 它解释了问题背后的问题并提出了 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_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionConsoleTrueTypeFont

价值观:

Name: 00
Data: Consolas

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

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

希望对你有帮助

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

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