rigaya / NVEnc

NVENCによる高速エンコードの性能実験
https://rigaya34589.blog.fc2.com/blog-category-17.html
Other
1.07k stars 112 forks source link

Fix file input issues in Chinese environment #596

Closed hoshinohikari closed 3 months ago

hoshinohikari commented 3 months ago

PS.This is a partial document extracted from msdn:

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:

    if (check_locale_is_ja()) {
        _tsetlocale(LC_ALL, _T("Japanese"));
    }
    else if (check_locale_is_chs()) {
        _tsetlocale(LC_ALL, _T(".UTF8"));
    }

after:

    _tsetlocale(LC_ALL, _T(".UTF8"));
rigaya commented 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"));
rigaya commented 3 months ago

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.