On Monday, 23 March 2020 at 01:18:15 UTC, walker wrote:
Which function should I use when I read Chinese characters in the terminal?

Terminal.getline *might* work in my lib, but if there's combining codepoints I'm not sure. You can try it though and let me know if you are already using the lib.

There's also ReadConsole in core.sys.windows.windows that isn't a bad experience (just Windows only). It works with `wstring` just like WriteConsole and is the native function with unicode support. The operating system also manages some editing for the user, cursor placement, etc. so is more likely to work better with edge cases than my library's custom implementation of all that.

https://docs.microsoft.com/en-us/windows/console/readconsole

Reply via email to