You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think i need an explanation about why NlsGetUserDefaultUICulture uses InitializeUserDefaultCulture instead of InitializeUserDefaultUICulture. I think this is why i get the wrong result when using CurrentUICulture when my process is running as system.
InitializeUserDefaultUICulture is calling NlsGetUserDefaultUICulture. We cannot make NlsGetUserDefaultUICulture to call InitializeUserDefaultUICulture or it will be infinite loop.
could you tell me more about your environment to investigate? we may have some bug somewhere. Are you turning Nls config switch on? otherwise, you'll be using ICU by default now which maybe the bug in this path.
Activity
tarekgh commentedon Apr 30, 2020
InitializeUserDefaultUICulture is calling NlsGetUserDefaultUICulture. We cannot make NlsGetUserDefaultUICulture to call InitializeUserDefaultUICulture or it will be infinite loop.
runtime/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.cs
Line 826 in 1db45ed
could you tell me more about your environment to investigate? we may have some bug somewhere. Are you turning Nls config switch on? otherwise, you'll be using ICU by default now which maybe the bug in this path.
CC @safern
tarekgh commentedon Apr 30, 2020
I think the bug is here
runtime/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.Icu.cs
Line 45 in 1db45ed
tarekgh commentedon Apr 30, 2020
thanks @Robert-LTH for reporting this issue. we'll try to fix this soon.
Robert-LTH commentedon Apr 30, 2020
Thank you for looking into this! I can add some info to this, it might help you understand my issue.
if i run
dism /online /get-intlit outputsDefault User Locale is sv-SE.
If i check the properties of
CultureInfo.CurrentUICultureit has LCID = 1053 (sv-SE). I expect this to be 1033 (en-US).tarekgh commentedon Apr 30, 2020
@Robert-LTH thanks for the info. I assume you are using v5.0 bits here as the whole discussion around that. Just to ensure we all in the same page.
As a workaround, if this is blocking you, you may use the config switch
runtime/src/libraries/System.Globalization/tests/NlsTests/runtimeconfig.template.json
Line 3 in dd22ce8
safern commentedon Apr 30, 2020
Thanks @Robert-LTH for reporting the issue. I've put up a PR to fix this: #35680