LocaleUtils.toLocale() rejects strings with only language+variant
-----------------------------------------------------------------

                 Key: LANG-328
                 URL: https://issues.apache.org/jira/browse/LANG-328
             Project: Commons Lang
          Issue Type: Bug
    Affects Versions: 2.3
            Reporter: Emmanuel Bourg


LocaleUtils.toLocale() throws an exception on strings containing a language and 
a variant but no country code. For example : fr__POSIX

This string can be produced with the JDK by instanciating a Locale with an 
empty string for the country : new Locale("fr", "", "POSIX").toString(). 
According to the javadoc for the Locale class a variant is allowed with just a 
language code or just a country code.

Commons Configuration handles this case in its PropertyConverter.toLocale() 
method. I'd like to replace our implementation by the one provided by 
LocaleUtils, but our tests fail due to this case.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to