Skip to content

Commit

Permalink
Merge pull request #596 from hoshinohikari/master
Browse files Browse the repository at this point in the history
Fix file input issues in Chinese environment
  • Loading branch information
rigaya authored Jun 25, 2024
2 parents cb29c34 + 796026f commit 0a292af
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 9 additions & 1 deletion NVEncC/NVEncC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@ bool check_locale_is_ja() {
return GetUserDefaultLangID() == LangID_ja_JP;
}

bool check_locale_is_chs() {
const WORD LangID_zh_CN = MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED);
return GetUserDefaultLangID() == LangID_zh_CN;
}

static tstring getErrorFmtStr(uint32_t err) {
TCHAR errmes[4097];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, NULL, errmes, _countof(errmes), NULL);
Expand Down Expand Up @@ -367,7 +372,10 @@ int _tmain(int argc, TCHAR **argv) {
#if defined(_WIN32) || defined(_WIN64)
if (check_locale_is_ja()) {
_tsetlocale(LC_ALL, _T("Japanese"));
}
}
else if (check_locale_is_chs()) {
_tsetlocale(LC_ALL, _T(".UTF8"));
}
#endif //#if defined(_WIN32) || defined(_WIN64)

if (argc == 1) {
Expand Down
6 changes: 6 additions & 0 deletions NVEncCore/NVEncFilterResize.cu
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ const TCHAR *NVRTC_BUILTIN_DLL_NAME_TSTR = _T("nvrtc-builtins64_122.dll");
#elif __CUDACC_VER_MAJOR__ == 12 && __CUDACC_VER_MINOR__ == 3
const TCHAR *NVRTC_DLL_NAME_TSTR = _T("nvrtc64_120_0.dll");
const TCHAR *NVRTC_BUILTIN_DLL_NAME_TSTR = _T("nvrtc-builtins64_123.dll");
#elif __CUDACC_VER_MAJOR__ == 12 && __CUDACC_VER_MINOR__ == 4
const TCHAR* NVRTC_DLL_NAME_TSTR = _T("nvrtc64_120_0.dll");
const TCHAR* NVRTC_BUILTIN_DLL_NAME_TSTR = _T("nvrtc-builtins64_124.dll");
#elif __CUDACC_VER_MAJOR__ == 12 && __CUDACC_VER_MINOR__ == 5
const TCHAR* NVRTC_DLL_NAME_TSTR = _T("nvrtc64_120_0.dll");
const TCHAR* NVRTC_BUILTIN_DLL_NAME_TSTR = _T("nvrtc-builtins64_125.dll");
#endif
#else //#if defined(_WIN32) || defined(_WIN64)
const TCHAR *NPPI_DLL_NAME_TSTR = _T("libnppc.so");
Expand Down

0 comments on commit 0a292af

Please sign in to comment.