On Sunday, 25 January 2015 at 16:22:20 UTC, AndyC wrote:
On Sunday, 25 January 2015 at 16:09:59 UTC, FrankLike wrote:
Many people want to display their string(ANSI),but always to
convert string by
'toMBSz',and it can't convert to immutable char[],it's
difficult to display their ANSI
string in CMD.EXE.
What do you think?
But .. some people switch cmd.exe to utf8, so you'll break them.
http://superuser.com/questions/269818/change-default-code-page-of-windows-console-to-utf-8
not to mention all the linux people it'll break.
Perhaps:
import std.windows.charset;
import std.conv;
then:
writeln(to!(string)(toMBSz(utf8)));
Why not switch by Version:
version(Windows)
{
writeln(to!(string)(toMBSz(utf8)));
}
else version(linux)
{
...
}