On Wed, 24 Jun 2026 20:44:30 GMT, Justin Lu <[email protected]> wrote:

> `Locale` currently states:
> 
> > BCP 47 deviation: this is not the full BCP 47 language production, since it 
> > excludes 
> > [extlang](https://datatracker.ietf.org/doc/html/rfc5646#section-2.2.2) (as 
> > modern three-letter language codes are preferred).
> 
> I think this wording is a little ambiguous. The intended meaning seems to be 
> that the Locale composition does not separately expose a primary `language` 
> _and_ `extlang`. (That is, we just normalize to `language` only.) As 
> currently written, it came off to me as though the `Locale` class does not 
> support "extlangs" altogether, (including during parsing).

I think the issue is that `java.util.Locale`’s `language` field is not the same 
thing as BCP 47’s `language` production.

In BCP 47, `language` can include `extlang`, but Locale’s `language` field does 
not. For example, Locale.of("en-foo") does not interpret foo as an `extlang`.

> @naotoj, what do you think? Do you think this is worth a clarification in a 
> separate issue?

Yes, this is definitely worth clarifying.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/31663#issuecomment-4793668895

Reply via email to