1 54 package org.w3c.tidy; 55 56 import junit.framework.TestCase; 57 58 59 64 public class EncodingNameMapperTest extends TestCase 65 { 66 67 71 public EncodingNameMapperTest(String name) 72 { 73 super(name); 74 } 75 76 79 public void testToJava() 80 { 81 assertEquals("UTF8", EncodingNameMapper.toJava("utf8")); 82 assertEquals("UTF8", EncodingNameMapper.toJava("UTF-8")); 83 assertEquals("ASCII", EncodingNameMapper.toJava("US-ASCII")); 84 assertEquals("ASCII", EncodingNameMapper.toJava("ASCII")); 85 assertEquals("ISO8859_1", EncodingNameMapper.toJava("LATIN1")); 86 assertEquals("ISO8859_1", EncodingNameMapper.toJava("ISO-8859-1")); 87 assertEquals("Cp1252", EncodingNameMapper.toJava("WINDOWS-1252")); 88 assertEquals("JIS", EncodingNameMapper.toJava("ISO2022")); 89 assertEquals("JIS", EncodingNameMapper.toJava("ISO-2022-JP")); 90 assertEquals("Big5", EncodingNameMapper.toJava("BIG5")); 91 assertEquals("Unicode", EncodingNameMapper.toJava("UTF16")); 92 assertEquals("UnicodeBig", EncodingNameMapper.toJava("UTF16BE")); 93 assertEquals("UnicodeLittle", EncodingNameMapper.toJava("UTF16LE")); 94 assertEquals("Unicode", EncodingNameMapper.toJava("UTF-16")); 95 assertEquals("UnicodeBig", EncodingNameMapper.toJava("UTF-16BE")); 96 assertEquals("UnicodeLittle", EncodingNameMapper.toJava("UTF-16LE")); 97 assertEquals("Cp858", EncodingNameMapper.toJava("CP858")); 98 assertEquals("Cp858", EncodingNameMapper.toJava("ibm858")); 99 assertEquals("MacRoman", EncodingNameMapper.toJava("Macintosh Roman")); 100 assertEquals("Cp1252", EncodingNameMapper.toJava("WiN1252")); 101 assertEquals("SJIS", EncodingNameMapper.toJava("SHIFTJIS")); 102 assertEquals(null, EncodingNameMapper.toJava("IBM-")); 103 } 104 105 } | Popular Tags |