[Mono-devel-list] Case sensitivity of CultureInfo names

Bernie Solomon bernard at ugsolutions.com
Sun Oct 12 22:14:24 EDT 2003

Having got going using ICU and trying running corlib tests I noticed various still failing due to unknown culture names because of case differences. I then did a little test using this program:

using System;
using System.Globalization;

class Test
    static public void Main()
        String [] s = new String [] { "en-us", "en-US", "EN-us", "EN-US", "En-Us" };
        foreach (String trial in s)
                CultureInfo ci = new CultureInfo(trial, true);
                Console.WriteLine(trial + ": " + ci.LCID);
            catch (Exception e)
                Console.WriteLine(trial + ": " + e);
}and all the names work under .Net itself. The documentation on the CultureInfo constructor seems to imply otherwise but it appears case does not matter there (of course whether this was by design we don't know).

However the new mono implementation is case sensitive and only en-US works - so it seems this should be made case insensitive as well (if not at least all the tests need fixing to use case correct versions).

Bernie Solomon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20031012/34c63a01/attachment.html 

More information about the Mono-devel-list mailing list