Closed hoshinohikari closed 3 months ago
Thank you for the pull request!
I've tested on my Japanese system, and can confirm that only setting ".UTF8" seems to work fine. Therefore, I think we can simply go with the one you written below. after:
_tsetlocale(LC_ALL, _T(".UTF8"));
f95e28ce changes only to _tsetlocale(LC_ALL, _T(".UTF8"));
.
Thanks again for your pull request.
I will release a new version soon including your commits, but please wait a little as I need to check for other changes.
PS.This is a partial document extracted from msdn:
UTF-8 support
Starting in Windows 10 version 1803 (10.0.17134.0), the Universal C Runtime supports using a UTF-8 code page. The change means that char strings passed to C runtime functions can expect strings in the UTF-8 encoding. To enable UTF-8 mode, use ".UTF8" as the code page when using setlocale. For example, setlocale(LC_ALL, ".UTF8") uses the current default Windows ANSI code page (ACP) for the locale and UTF-8 for the code page.
According to the latest documentation, when using _tsetlocal, it is possible to use ". UTF8" instead of specifying a language, which can include all languages and avoid file input exceptions caused by system coding. However, I only have Windows in Chinese and English environments, and I still need to test it in Japanese environments. If ". UTF8" can be used, the following code can be directly changed to:
before:
after: