lhmouse / nano-win

GNU nano text editor for Windows [WARNING: The master branch is constantly rebased and force-pushed so don't expect it to be steady!! -end WARNING]
https://files.lhmouse.com/nano-win/
GNU General Public License v3.0
210 stars 25 forks source link

Non-English Characters #8

Open webfolderio opened 5 years ago

webfolderio commented 5 years ago

Thanks for the great port. It works quite well on my Windows 10 except non-English characters.

When i press a non-English character, nano did not print the char.

lhmouse commented 5 years ago

It does not work for me either. FFS ncursesw (the W variant) seems to want MBCS to be in UTF-8 but native Windows CRT only works with the system's code page which is unlikely UTF-8 (it is 936 on my Simplified Chinese system) so it never worked perfectly.

P.S. You may want to tamper with the configure options to both nano and ncurses and see whether it works. These are beyond my ken. Sorry.

sergeevabc commented 4 years ago

Perhaps someone has found a workaround to switch & type in non-English?

eabase commented 2 years ago

Yep, it totally crashes when changing windows keyboard to another language and type anything. Need to kill process!

webfolderio commented 2 years ago

@lhmouse nano build with mingw64 and it uses msvcrt.dll. msvcrt doesn't support utf-8 and this might be the root cause for Non-English chars. As you might know Windows 10 comes with new C-Runtime (UCRT). UCRT supports utf-8 and support POSIX better.

I didn't try but build nano-win with ucrt based compiler will fix the issue.

There are two ways to compile nano-win with ucrt based compiler.

Option 1: Using MSYS2, requires Windows env. and there is a mingw64 ucrt based dev. env. mingw64 ucrt based doesn't work on Linux.

Option 2: There is an llvm-mingw which supports ucrt based c-runtime and works on both Windows & Linux: https://github.com/mstorsjo/llvm-mingw

What you think about this solution?

Thanks