How To /
Locale Write Console
Difference (previous author) (Change, Edit, normal page display)
Changed: 1c1,27
Describe the new page here. |
This code is tested on Window 2000, Simpled Chinese version. locale_cn.d private import std.c.stdio; extern(C) int setlocale(int, char*); static this() { fwide(stdout, 1); setlocale(0, "china"); } manitest.d import std.stdio; int main() { writefln("chinese 中文 \u4E2D\u6587"); return 0; } compile with: dmd maintest.d locale_cn.d |
This code is tested on Window 2000, Simpled Chinese version.
locale_cn.d
private import std.c.stdio; extern(C) int setlocale(int, char*);
static this() {
fwide(stdout, 1); setlocale(0, "china");}
manitest.d
import std.stdio;
int main() {
writefln("chinese 中文 \u4E2D\u6587"); return 0;}
compile with:
dmd maintest.d locale_cn.d