I was wondering if anyone knows how to get formatted or styled codes from the Locale class. What i would like to see is "en_US" for English for US. For example, if i detect a language from Firefox it comes back as "en-us,en;q=0.5". Later when I want to output it (using getLanguage() or toString()) it comes back as "en-us,en;q=0.5" instead of "en_US". I tried various functions, but they all seem to return the string that was used to generate the Locale in the first place.
These values go into various UI elements and config files, so it would be nicer to have them looking the same regardless of who or how it was generated and also comparison is not easy when they are converted to strings (have to be).
Cheers and Thanks!
NOTE: I am asking this because we have legacy code that does alot (and i really mean most) of things when data is in string/xml format, so formatting is crucial.