-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P4
-
Affects Version/s: 27
-
Component/s: core-libs
-
Cause Known
Locale states that
"Well-formed {@code variant} values have the form {@code SUBTAG (('_'|'-') SUBTAG)*} ... BCP 47 only uses hyphen ('-') as a delimiter, {@code Locale} is more lenient."
However, there is a wide range of behavior which makes the lack of detail confusing.
`Locale.of` can take multiple variants separated by underscore.
`Locale.forLanguageTag` allows multiple variants separated by hyphen.
`Locale.Builder.setLanguageTag` allows variants only separated by hyphen.
`Locale.Builder.setVariant` allows multiple variants separated by either underscore or hyphen.
"Well-formed {@code variant} values have the form {@code SUBTAG (('_'|'-') SUBTAG)*} ... BCP 47 only uses hyphen ('-') as a delimiter, {@code Locale} is more lenient."
However, there is a wide range of behavior which makes the lack of detail confusing.
`Locale.of` can take multiple variants separated by underscore.
`Locale.forLanguageTag` allows multiple variants separated by hyphen.
`Locale.Builder.setLanguageTag` allows variants only separated by hyphen.
`Locale.Builder.setVariant` allows multiple variants separated by either underscore or hyphen.
- csr for
-
JDK-8378875 Locale variant delimiter is unclear
-
- Draft
-
- links to
-
Review(master)
openjdk/jdk/29970