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

FrankLike 1150015857 at qq.com
Thu Jan 24 07:48:44 UTC 2019


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 works very ok.
But After D2.080 ,It not works.
Who can help me?
Thank you.


More information about the Digitalmars-d-learn mailing list