Skip to content

msvcrt: Switch to using snames for create_locinfo.

This MR attempts to bring Wine's handling of setlocale and _create_locale more in line with the behavior of native >= msvcr110. It does this by replacing the usage of the LCID based GetLocaleInfo with the sname based GetLocaleInfoEx. GetLocaleInfo doesn't support neutral locales, even on native, which causes problems with neutral Chinese locales like zh-Hans and zh-Hant.

It also improves the accuracy of the internal __lc_locale_name_func, as tests indicate that it returns LOCALE_SNAMEs instead of ISO 639 language names.

Potential future improvements:

  • Modifying the generation of the pclmap and pcumap fields of threadlocaleinfostruct to work on WCHARs.
  • I've done some changes to __thread_data which make it not fully match native, I'll submit a follow up which fixes this.

Merge request reports

Loading