Locales including scripts are not round-tripped properly by LocaleTypeDescriptor. An example of such a locale is “zh-Hant-HK”, which gets converted to a String as “zh_HK_#Hant” but read back as “zh-Hant”.
LocaleTypeDescriptor.fromString builds the Locale instance using the Locale constructor, which does not allow specifying a script or extension; alternatives would be to use Locale.forLanguageTag, or Locale.Builder. |
|