localization - Should i use _ (underscore) or - (dash) while using locale id? -


why java.util.locale.us show en_us, when construct why need pass "en-us"?

what difference between this.

you see both versions quite often. however, rfc 5646 (which part of ietf bcp 47 document series) prescribes hyphen separator character: https://tools.ietf.org/html/rfc5646

java seems allow both versions: http://docs.oracle.com/javase/7/docs/api/java/util/locale.html

quote: "well-formed variant values have form subtag (('_'|'-') subtag)* subtag = [0-9][0-9a-za-z]{3} | [0-9a-za-z]{5,8}. (note: bcp 47 uses hyphen ('-') delimiter, more lenient)"

cheers,

martin


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -