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

FrankLike 1150015857 at qq.com
Sat Jan 26 06:03:25 UTC 2019


On Friday, 25 January 2019 at 15:05:50 UTC, John Chapman wrote:
> On Friday, 25 January 2019 at 14:23:15 UTC, FrankLike wrote:
>> I need to set the font by the code now, because I need to do 
>> the installer, can't let this installer set the properties on 
>> each computer?
>
> SetCurrentConsoleFontEx perhaps?
>
> https://docs.microsoft.com/en-us/windows/console/setcurrentconsolefontex

That's so much code than next code.

///////////////////////////////////////////////
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");
}
///////////////////////////////////
But After D2.078.1,it's not work.
Why?
Thank you.


More information about the Digitalmars-d-learn mailing list