[loc-en-dev] Fwd: toLanguageTag problem

Andy Staudacher staudacher at google.com
Wed Jan 26 19:51:23 PST 2011


+1

Thanks!

On Wed, Jan 26, 2011 at 6:40 PM, Yoshito Umaoka <y.umaoka at gmail.com> wrote:

>  Hmm.. My original message had gone somewhere. Resending.
>
>
> -------- Original Message --------  Subject: toLanguageTag problem  Date: Wed,
> 26 Jan 2011 16:08:05 -0500  From: Yoshito Umaoka <y.umaoka at gmail.com><y.umaoka at gmail.com>  To:
> locale-enhancement-dev at openjdk.java.net
>
> Hi all,
>
> I found a problem in Locale#toLanguageTag(). When an instance of Locale
> has no language, toLanguageTag() supplies "und" as the language subtag.
> This is a requirement of "langtag" construction of BCP47 language tag.
>
>  langtag       = language
>                  ["-" script]
>                  ["-" region]
>                  *("-" variant)
>                  *("-" extension)
>                  ["-" privateuse]
>
> However, it is not necessary if the Locale only has private use value.
> Because a BCP47 language tag could be private use alone.
>
>  Language-Tag  = langtag             ; normal language tags
>                / privateuse          ; private use tag
>                / grandfathered       ; grandfathered tags
>
>
>
> For example,
>
> Locale.forLanguageTag("x-elmer").toLanguageTag()
>
> Above currently returns "und-x-elmer", but it should actually return
> "x-elmer". I'm going to file a bug for this issue.
>
> -Yoshito
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/locale-enhancement-dev/attachments/20110126/16eb55dd/attachment.html 


More information about the locale-enhancement-dev mailing list