What is the alternative to the setlocale function of c in D? Thank you.

FrankLike 1150015857 at qq.com
Thu Jan 24 07:59:35 UTC 2019


On Thursday, 24 January 2019 at 07:48:44 UTC, FrankLike wrote:
> Hi,everyone,
>
> for example:
>
> import std.stdio;
> import std.process:executeShell;
>
> extern(C) int setlocale(int,char*);
>
> static this()
> {
> 	import core.stdc.wchar_;
> 	import core.stdc.stdio;
> 	fwide(core.stdc.stdio.stdout,1);
> 	setlocale(0,cast(char*)"china");
> }
>
> void main()
> {
> 	writeln("字符");
> 	executeShell("pause");
> }
> ///////////////////////code end/////////////////////////////
In D2.078.1 It can display Chinese characters correctly!
But After D2.080 , but it can't be used now.
Who can help me?
Thank you.




More information about the Digitalmars-d-learn mailing list