locale - Java method setLanguageTag() accepts invalid region code -


the method setlanguagetag() of class locale.builder class validates locale. acceptable locale given in java doc .

the standard states valid locale has region of regex [a-za-z]{2} | [0-9]{3}. method validates language usa ( 3 characters )

i gave input locale en-usa , correctly validated. isn't bug in method should have thrown exception ?

[edit] mean en-usa valid locale ? mistaking usa other tag being region ? , reason why validating it.

so, went through code , found out there category extlang in locale , accepts 3 characters. accepts part after - extlang rather country. locale "en-usa" gets validated.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -