Winim library from Ward has a lot of facilities to deal with windows strings.
Look it up on github.
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)
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
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
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
Are you truly, positively sure ?
[https://www.ascii-codes.com/cp866.html](https://www.ascii-codes.com/cp866.html)
A `char` cannot hold a cyrillic letter, that's what the runtime is trying to
tell you.
Yes, Araq. Neither can Windows' console (before Win10, at least), since it all
ASCII.
...Except it works with cyrillic letter, of course.
`getch` returns a `char` and so it cannot work with Unicode. Surprise, surprise!
I'm pretty sure unicode was broken in all kind of ways in 2004, terminal or not.
> 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
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)?
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:
13 matches
Mail list logo