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

FrankLike 1150015857 at qq.com
Thu Jan 24 15:58:18 UTC 2019


On Thursday, 24 January 2019 at 12:19:44 UTC, Kagamin wrote:
> Try workarounds here:
> https://issues.dlang.org/show_bug.cgi?id=1448
> https://issues.dlang.org/show_bug.cgi?id=2742

Ok,thank you.

import std.stdio;
import core.sys.windows.windows;
import std.process:executeShell;
extern(Windows) bool SetConsoleOutputCP(uint);

void main()
{
	SetConsoleOutputCP(65001);
	writeln("字符");
	executeShell("pause");
}



More information about the Digitalmars-d-learn mailing list