Fix for locale handling changes in ICU 64

Since ICU 64, the locale handling has changed such that passing an empty string to uloc_canonicalize no longer returns the en_US_POSIX locale as it did in previous versions. 
See https://icu.unicode.org/download/64#h.plg55ia6o3du
This commit is contained in:
sbeard-eh 2022-11-01 20:20:48 +00:00 committed by GitHub
parent 37f5a2f9e1
commit 1a3d869ab1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -536,7 +536,15 @@ static NSRecursiveLock *classLock = nil;
if (nil == systemLocale)
{
#if GS_USE_ICU == 1
#if U_ICU_VERSION_MAJOR_NUM >= 64
/* Since ICU 64, the locale handling has changed such that passing an
empty string to uloc_canonicalize no longer returns the en_US_POSIX
locale as it did in previous versions.
See https://icu.unicode.org/download/64#h.plg55ia6o3du */
systemLocale = [[NSLocale alloc] initWithLocaleIdentifier: @"en_US_POSIX"];
#else
systemLocale = [[NSLocale alloc] initWithLocaleIdentifier: @""];
#endif
#endif
}