[loc-en-dev] variant field casing

Naoto Sato Naoto.Sato at Sun.COM
Fri Jul 10 15:36:18 PDT 2009


Sounds reasonable.  I don't see any reason we should distinguish the 
variant's case.

Naoto

Yoshito Umaoka wrote:
> Hi folks,
>
> Variant field in Java Locale is case sensitive.  For example -
>
> System.out.println(new Locale("th", "TH", "TH").equals(new 
> Locale("th", "TH", "th")));
> System.out.println(new Locale("th", "TH", "TH").equals(new 
> Locale("th", "th", "TH")));
>
> These statements print out the results -
>
> false
> true
>
> I cannot see any descriptions about variant field casing in the API 
> doc.  I think this behavior is problematic if we want to make Locale 
> to handle language tags (which is case in-sensitive) properly.  I 
> propose to document that all locale fields are case insensitive and 
> change the behavior.  I know this is not backward compatible, but we 
> probably should correct the behavior.
>
> By the way, IANA language subtag registry uses lower case letters for 
> variant subtags.  And the format used in the registry is the preferred 
> casing.
>
> -Yoshito
>




More information about the locale-enhancement-dev mailing list