swift-foundation
swift-foundation copied to clipboard
Initiating a Locale/Language with empty language code/script/region results in an unreasonable locale.
Here are some examples:
print(Locale(languageCode: "", script: "", languageRegion: "").identifier) // "-_"
let languageComponents = Locale.Language.Components(language: .init(identifier:""))
print(Locale(languageComponents: languageComponents).identifier) // "-Latn"
Fix this by handling empty identifiers passed in at initialization time correctly.
resolves 132353443