[loc-en-dev] Locale Display Name with script
Yoshito Umaoka
y.umaoka at gmail.com
Fri Mar 6 10:30:13 PST 2009
Doug Felt wrote:
> The builder defaults language to 'und'
>
Hmmm.. I think I should clarify this..
Builder defaults language to empty string, but when you convert it to a
language tag, "und" is used. For example,
Locale loc = new Builder().setRegion("US").create();
String locStr = loc.toString();
String langtag = loc.toLanguageTag();
In this code,
locStr -> _US
langtag -> und-us
If we want to avoid this, one possible option is to mandate non-empty
language in Builder#create(). But, we cannot use
IllegalArgumentException here obviously!
-Yoshito
More information about the locale-enhancement-dev
mailing list