Store current language locale as a CoreFoundation locale. */
| 314 | |
| 315 | /** Store current language locale as a CoreFoundation locale. */ |
| 316 | void MacOSSetCurrentLocaleName(std::string_view iso_code) |
| 317 | { |
| 318 | if (!MacOSVersionIsAtLeast(10, 5, 0)) return; |
| 319 | |
| 320 | CFAutoRelease<CFStringRef> iso(CFStringCreateWithBytes(kCFAllocatorDefault, reinterpret_cast<const UInt8 *>(iso_code.data()), iso_code.size(), kCFStringEncodingUTF8, false)); |
| 321 | _osx_locale.reset(CFLocaleCreate(kCFAllocatorDefault, iso.get())); |
| 322 | } |
| 323 | |
| 324 | /** |
| 325 | * Compares two strings using case insensitive natural sort. |
no test coverage detected