From e25e6e3e81b49568dcfd34382ae58455e907c8ff Mon Sep 17 00:00:00 2001 From: Woongsuk Cho Date: Thu, 9 Apr 2020 15:33:01 +0900 Subject: [PATCH] In some specific language (az, tr, ku, etc), FileNotFoundException is occurred even though the dll exist. coreclr keep TPA lists at hashmap(SimpleNameToFileNameMap) in the applicationcontext. To add TPA to hashmap, hash code is generated by hash() function with simple name of dll. In that hash function, towupper() function is used. The return value of towupper() can be changed by locale setting. Also, when lookup in hashmap, towlower() function is called for comparing values, and the return value of this function also changed according to locale. To prevent key mismatch issue by locale change, set to the locale before coreclr_initialize(). --- NativeLauncher/launcher/lib/dotnet_launcher.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/NativeLauncher/launcher/lib/dotnet_launcher.cc b/NativeLauncher/launcher/lib/dotnet_launcher.cc index c900ef2..d9d14bc 100644 --- a/NativeLauncher/launcher/lib/dotnet_launcher.cc +++ b/NativeLauncher/launcher/lib/dotnet_launcher.cc @@ -267,8 +267,7 @@ static void setLang() // As a result, CultureInfo is incorrectly generated and malfunctions. // For example, uloc_getDefault() returns en_US_POSIX, CultureInfo is set to invariant mode. setenv("LANG", const_cast(lang), 1); - setenv("LC_MESSAGES", const_cast(lang), 1); - setenv("LC_ALL", const_cast(lang), 1); + setlocale(LC_ALL, const_cast(lang)); free(lang); } -- 2.7.4