Re: getch() vs Cyrillic on Windows.

2019-04-10 Thread zulu
Winim library from Ward has a lot of facilities to deal with windows strings. Look it up on github.

Re: getch() vs Cyrillic on Windows.

2019-04-10 Thread Aiesha_Nazarothi
Feel your pain. I gave up and ended with this project myself already: [https://github.com/Guevara-chan/ConIO](https://github.com/Guevara-chan/ConIO)

Re: getch() vs Cyrillic on Windows.

2019-04-08 Thread LeFF
CP866 is usually used for console programs on Russian version of windows (which is OEMCP), and CP1251 is usually used for gui programs on Russian version of Windows (which is ACP). Technically I don't really see any reason why this shouldn't be working with char types. However I would rather be

Re: getch() vs Cyrillic on Windows.

2019-04-07 Thread zolern
I would not say that Nim has perfect support for Unicode in Windows console because it hasn't. Neither input, nor output of unicode chars works out of the box in any version of Windows from WinXP x32 ANSI to Windows 10 x64 Unicode. But actually it is not Nim fault, but creepy Windows/MSDOS

Re: getch() vs Cyrillic on Windows.

2019-04-07 Thread lucian
It may be due to how the console is treated. winlean library implementation seem to default to wide-chars operations instead of your expected one byte char. Try compiling with this flag, see if it makes any diffeence for you: -d:useWinAnsi| ---|--- For me is not working as that mode

Re: getch() vs Cyrillic on Windows.

2019-04-07 Thread Aiesha_Nazarothi
Are you truly, positively sure ? [https://www.ascii-codes.com/cp866.html](https://www.ascii-codes.com/cp866.html)

Re: getch() vs Cyrillic on Windows.

2019-04-07 Thread Araq
A `char` cannot hold a cyrillic letter, that's what the runtime is trying to tell you.

Re: getch() vs Cyrillic on Windows.

2019-04-06 Thread Aiesha_Nazarothi
Yes, Araq. Neither can Windows' console (before Win10, at least), since it all ASCII. ...Except it works with cyrillic letter, of course.

Re: getch() vs Cyrillic on Windows.

2019-04-06 Thread Araq
`getch` returns a `char` and so it cannot work with Unicode. Surprise, surprise!

Re: getch() vs Cyrillic on Windows.

2019-04-06 Thread mratsim
I'm pretty sure unicode was broken in all kind of ways in 2004, terminal or not.

Re: getch() vs Cyrillic on Windows.

2019-04-06 Thread Aiesha_Nazarothi
> Hi! No need to get aggressive :-) Yes, sure. Except... * Except this is my second project using and second time I utterly regret touching it. * Except I use "obscure" languages my whole life (Forth, Boo, Rebol, CoffeeScript, PureBasic) and never yet had so much problems with simple

Re: getch() vs Cyrillic on Windows.

2019-04-03 Thread moigagoo
Hi! No need to get aggressive :-) There are bugs out there, no doubt about that. Any help reporting and fixing them is very much appreciated. Could you please [report the issue](https://github.com/nim-lang/Nim/issues/new?template=bug_report.md)?

getch() vs Cyrillic on Windows.

2019-04-03 Thread Aiesha_Nazarothi
Just found that thing recently while working on [https://github.com/Guevara-chan/NimVPN](https://github.com/Guevara-chan/NimVPN) So, you use _terminal_ on Windows and want to get character by _getch_ , right ? Then, you press, like, 'н' or 'т' and hell breaks loose: