In some specific language (az, tr, ku, etc), FileNotFoundException is occurred even... accepted/tizen/5.5/unified/20200413.002422 submit/tizen_5.5/20200410.075951
authorWoongsuk Cho <ws77.cho@samsung.com>
Thu, 9 Apr 2020 06:33:01 +0000 (15:33 +0900)
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>
Fri, 10 Apr 2020 01:03:59 +0000 (10:03 +0900)
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

index c900ef2..d9d14bc 100644 (file)
@@ -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<char *>(lang), 1);
-       setenv("LC_MESSAGES", const_cast<char *>(lang), 1);
-       setenv("LC_ALL", const_cast<char *>(lang), 1);
+       setlocale(LC_ALL, const_cast<char *>(lang));
 
        free(lang);
 }