I am a Chinese Windows user.

I use Msys2+Mingw64 (export LANG="EN.UTF-8") to compile nim app. But I also use 
windows7 DOS console(the default codepage is cp936, which is almost gb2312). 
The following code performs different in msys2 and windows's console.

So my question, how to let the EXE echo properly no matter in whatever 
consoles? Thanks
    
    
    # this file is saved as a UTF8 file
    
    import future, encodings
    
    # this line outputs "你好" in msys which is corrected.
    # but "浣犲ソ" in windows' console which is wrong
    echo "你好"
    
    
    # this outputs "▒▒▒" in msys which is wrong.
    # but "你好" in DOS which is corrected
    echo convert("你好", "gb2312", "utf8")
    
    

Reply via email to