Last update November 30, 2005

How To /
Locale Write Console



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


FrontPage | News | TestPage | MessageBoard | Search | Contributors | Folders | Index | Help | Preferences | Edit

Edit text of this page (date of last change: November 30, 2005 8:53 (diff))