Re: echo proper string in different consoles?

2017-06-22 Thread oyster
thanks but set cp936 seems do not work in msys2 [https://github.com/zacharycarter/blt-nim](https://github.com/zacharycarter/blt-nim) may be a solution for simple console-like interactive

Re: echo proper string in different consoles?

2017-06-21 Thread Tiberium
There's a simpler way to change the codepage import os discard execShellCmd("chcp 936")

Re: echo proper string in different consoles?

2017-06-20 Thread Krux02
Don't use Windows. Seems to be bad software No seriously. I have no idea. I can only guess what to look for. Does msys2 try to make `getCurrentEncoding` behave correctly? Does msys2 try to make everything more unix like and make the shell utf8? Does msys2 have any information about encoding?

Re: echo proper string in different consoles?

2017-06-20 Thread Araq
Don't use msys? Seems to be bad software.

Re: echo proper string in different consoles?

2017-06-20 Thread oyster
actually I have tested getCurrentEncoding, which gives gb2312 in both msys and DOS as Araq says. So what is the solution?

Re: echo proper string in different consoles?

2017-06-20 Thread Araq
Are you sure? `getCurrentEncoding` maps to some Windows API call but how does the Windows API know about Msys2's non-standard default encoding?

Re: echo proper string in different consoles?

2017-06-19 Thread planhths
You need to use proc getCurrentEncoding(). This file has exactly what you need [https://github.com/retsyo/xlsx2csv/blob/master/develop/xlsx2csv.nim](https://github.com/retsyo/xlsx2csv/blob/master/develop/xlsx2csv.nim)

echo proper string in different consoles?

2017-06-19 Thread oyster
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