Wired question related with Chinese characters

walker growup_wei at qq.com
Tue Mar 31 11:27:43 UTC 2020


On Sunday, 29 March 2020 at 10:36:53 UTC, lovemini wrote:
> import std.stdio;
>
> void main()
> {
> 	version( Windows ) {
> 		//直接运行中文显示乱码,原因在于Windows控制台默认编码为 936,而D语言输出utf-8
> 		//可以将控制台编码修改为 utf-8,命令为 "CHCP 65001"
> 		//修改后就可以显示中文了
> 		import core.sys.windows.windows;
> 		SetConsoleCP(65001);
> 		SetConsoleOutputCP( 65001 );
> 	}
>
>     writeln("Hello World! 你好,中国!");
> }

Thank you, Chinese output works now, but the Chinese input 
doesn't work. How to change input behaviors?


More information about the Digitalmars-d-learn mailing list