I consider case-sensitivity a bug, dunno about missing aliases. As they are for convinience, the more the better? ----------------------------- java: Blackdown 1.4.2-01 jamvm-cvs: jamvm 1.2.4 + classpath CVS $ java Test utf-8 = true utf8 = true iso-8859-1 = true latin1 = true UTF-8 = true UTF8 = true ISO-8859-1 = true LATIN1 = true $ jamvm-cvs Test utf-8 = false utf8 = false iso-8859-1 = false latin1 = false UTF-8 = true UTF8 = false ISO-8859-1 = true LATIN1 = false $ -------------------------------- import java.nio.charset.Charset; public class Test { static String [] list = { "utf-8", "utf8", "iso-8859-1", "latin1", "UTF-8", "UTF8", "ISO-8859-1", "LATIN1", }; public static void main(String [] args) { for (int i = 0; i < list.length; i++) { String cs = list[i]; System.out.println(cs + " = " + Charset.isSupported(cs)); } } }
The mauve test for this is/will be gnu.testlet.java.nio.charset.Charset.forName2 It checks the availability of of certain charsets using case-insensitive names. A couple of them will fail on JDK <= 1.5. public void test(TestHarness h) { /* * Check for standard encodings using case-insensitive and alternative * names. */ // IANA name for UTF-8 checkCharset(h, "uTf-8"); // UTF-8 names from // http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html checkCharset(h, "utf8"); checkCharset(h, "UtF-16bE"); checkCharset(h, "uTf-16Le"); // IANA names for 8859_1 checkCharset(h, "IsO-iR-100"); checkCharset(h, "iSo_8859-1"); checkCharset(h, "LATIN1"); checkCharset(h, "L1"); checkCharset(h, "IbM819"); checkCharset(h, "cp819"); checkCharset(h, "CSisolATIN1"); // IANA names for US-ASCII checkCharset(h, "iSo-Ir-6"); checkCharset(h, "AnSi_X3.4-1986"); checkCharset(h, "IsO_646.IRV:1991"); checkCharset(h, "AsCiI"); checkCharset(h, "IsO646-us"); checkCharset(h, "Us"); checkCharset(h, "IbM367"); checkCharset(h, "cP367"); checkCharset(h, "CSASCII"); // UTF-8 names from // http://oss.software.ibm.com/cgi-bin/icu/convexp?s=ALL /* These fail on official implementation of <= 1.5 */ checkCharset(h, "ibm-1208"); checkCharset(h, "ibm-1209"); checkCharset(h, "ibm-5304"); checkCharset(h, "ibm-5305"); checkCharset(h, "windows-65001"); checkCharset(h, "cp1208"); }
Forgot to mark this as fixed.