Description
Some SqlString
APIs are relying on LCID numbers to represent users' cultures, e.g.,
This can cause issues when user's culture is not part of https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Globalization/IcuLocaleData.cs (e.g., en-CZ
), causing the returned LCID to be 0x1000 (LOCALE_CUSTOM_UNSPECIFIED
), that is not acceptable by some CultureInfo
APIs, e.g.,
The use of LCID is not recommended:
Note that LCIDs are being deprecated, and implementers are strongly encouraged to use newer versions of APIs that support BCP 47 locale names instead. Each LCID can be represented by a BCP 47 locale name, but the reverse is not true. The LCID range is restricted and unable to uniquely identify all the possible combinations of language and region.
https://learn.microsoft.com/en-us/globalization/locale/other-locale-names#lcid and the use of culture names is preferred.
cc: @tarekgh