test_class.declarator: logger = LoggerFactory.getLogger(CharsetUtilTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger logger = LoggerFactory.getLogger(CharsetUtilTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.file: ch-commons-charset/src/test/java/com/cloudhopper/commons/charset/CharsetUtilTest.java
test_class.identifier: CharsetUtilTest
test_case.body: @Test
      public void normalize() throws Exception {
          String in = null;
  
          // try every charset with simple A-Z, a-z, and 0-9 which should work in all charsets
          in = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefjhijklmnopqrstuvwxyz01234567890?&@";
          for (Map.Entry<String,Charset> entry : CharsetUtil.getCharsetMap().entrySet()) {
              Assert.assertEquals("Charset " + entry.getKey() + " implementation broken", in, CharsetUtil.normalize(in, entry.getValue()));
          }
  
          in = "\u20AC";  // euro currency char (only supported in a couple charsets)
          Assert.assertEquals("\u20AC", CharsetUtil.normalize(in, CharsetUtil.CHARSET_GSM));
          Assert.assertEquals("\u20AC", CharsetUtil.normalize(in, CharsetUtil.CHARSET_PACKED_GSM));
          Assert.assertEquals("\u20AC", CharsetUtil.normalize(in, CharsetUtil.CHARSET_AIRWIDE_GSM));
          Assert.assertEquals("\u20AC", CharsetUtil.normalize(in, CharsetUtil.CHARSET_VFD2_GSM));
          Assert.assertEquals("\u20AC", CharsetUtil.normalize(in, CharsetUtil.CHARSET_VFTR_GSM));
          Assert.assertEquals("?", CharsetUtil.normalize(in, CharsetUtil.CHARSET_ISO_8859_1));
          Assert.assertEquals("\u20AC", CharsetUtil.normalize(in, CharsetUtil.CHARSET_ISO_8859_15));
          Assert.assertEquals("\u20AC", CharsetUtil.normalize(in, CharsetUtil.CHARSET_UCS_2));
          Assert.assertEquals("\u20AC", CharsetUtil.normalize(in, CharsetUtil.CHARSET_UCS_2LE));
          Assert.assertEquals("\u20AC", CharsetUtil.normalize(in, CharsetUtil.CHARSET_UTF_8));
          Assert.assertEquals("\u20AC", CharsetUtil.normalize(in, CharsetUtil.CHARSET_TMOBILENL_GSM));
  
          in = "\u6025";  // arabic char (only supported in a couple charsets)
          Assert.assertEquals("?", CharsetUtil.normalize(in, CharsetUtil.CHARSET_GSM));
          Assert.assertEquals("?", CharsetUtil.normalize(in, CharsetUtil.CHARSET_PACKED_GSM));
          Assert.assertEquals("?", CharsetUtil.normalize(in, CharsetUtil.CHARSET_AIRWIDE_GSM));
          Assert.assertEquals("?", CharsetUtil.normalize(in, CharsetUtil.CHARSET_VFD2_GSM));
          Assert.assertEquals("?", CharsetUtil.normalize(in, CharsetUtil.CHARSET_VFTR_GSM));
          Assert.assertEquals("?", CharsetUtil.normalize(in, CharsetUtil.CHARSET_ISO_8859_1));
          Assert.assertEquals("?", CharsetUtil.normalize(in, CharsetUtil.CHARSET_ISO_8859_15));
          Assert.assertEquals("\u6025", CharsetUtil.normalize(in, CharsetUtil.CHARSET_UCS_2));
          Assert.assertEquals("\u6025", CharsetUtil.normalize(in, CharsetUtil.CHARSET_UCS_2LE));
          Assert.assertEquals("\u6025", CharsetUtil.normalize(in, CharsetUtil.CHARSET_UTF_8));
          Assert.assertEquals("?", CharsetUtil.normalize(in, CharsetUtil.CHARSET_TMOBILENL_GSM));
      }
test_case.class_method_signature: CharsetUtilTest.normalize()
test_case.full_signature: @Test public void normalize()
test_case.identifier: normalize
test_case.invocations: entrySet getCharsetMap assertEquals getKey normalize getValue assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize assertEquals normalize
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void normalize()
focal_class.declarator: charsets
focal_class.modifier: public static final
focal_class.original_string: public static final HashMap<String,Charset> charsets;
focal_class.type: HashMap<String,Charset>
focal_class.var_name: charsets
focal_class.declarator: NAME_ISO_8859_1 = "ISO-8859-1"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME_ISO_8859_1 = "ISO-8859-1";
focal_class.type: String
focal_class.var_name: NAME_ISO_8859_1
focal_class.declarator: NAME_ISO_8859_15 = "ISO-8859-15"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME_ISO_8859_15 = "ISO-8859-15";
focal_class.type: String
focal_class.var_name: NAME_ISO_8859_15
focal_class.declarator: NAME_GSM = "GSM"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME_GSM = "GSM";
focal_class.type: String
focal_class.var_name: NAME_GSM
focal_class.declarator: NAME_PACKED_GSM = "PACKED-GSM"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME_PACKED_GSM = "PACKED-GSM";
focal_class.type: String
focal_class.var_name: NAME_PACKED_GSM
focal_class.declarator: NAME_UCS_2 = "UCS-2"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME_UCS_2 = "UCS-2";
focal_class.type: String
focal_class.var_name: NAME_UCS_2
focal_class.declarator: NAME_UCS_2LE = "UCS-2LE"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME_UCS_2LE = "UCS-2LE";
focal_class.type: String
focal_class.var_name: NAME_UCS_2LE
focal_class.declarator: NAME_UTF_8 = "UTF-8"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME_UTF_8 = "UTF-8";
focal_class.type: String
focal_class.var_name: NAME_UTF_8
focal_class.declarator: NAME_MODIFIED_UTF8 = "MODIFIED-UTF8"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME_MODIFIED_UTF8 = "MODIFIED-UTF8";
focal_class.type: String
focal_class.var_name: NAME_MODIFIED_UTF8
focal_class.declarator: NAME_AIRWIDE_IA5 = "AIRWIDE-IA5"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME_AIRWIDE_IA5 = "AIRWIDE-IA5";
focal_class.type: String
focal_class.var_name: NAME_AIRWIDE_IA5
focal_class.declarator: NAME_VFD2_GSM = "VFD2-GSM"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME_VFD2_GSM = "VFD2-GSM";
focal_class.type: String
focal_class.var_name: NAME_VFD2_GSM
focal_class.declarator: NAME_VFTR_GSM = "VFTR-GSM"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME_VFTR_GSM = "VFTR-GSM";
focal_class.type: String
focal_class.var_name: NAME_VFTR_GSM
focal_class.declarator: NAME_GSM7 = "GSM7"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME_GSM7 = "GSM7";
focal_class.type: String
focal_class.var_name: NAME_GSM7
focal_class.declarator: NAME_GSM8 = "GSM8"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME_GSM8 = "GSM8";
focal_class.type: String
focal_class.var_name: NAME_GSM8
focal_class.declarator: NAME_AIRWIDE_GSM = "AIRWIDE-GSM"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME_AIRWIDE_GSM = "AIRWIDE-GSM";
focal_class.type: String
focal_class.var_name: NAME_AIRWIDE_GSM
focal_class.declarator: NAME_TMOBILENL_GSM = "TMOBILE-NL-GSM"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME_TMOBILENL_GSM = "TMOBILE-NL-GSM";
focal_class.type: String
focal_class.var_name: NAME_TMOBILENL_GSM
focal_class.declarator: CHARSET_ISO_8859_1 = new ISO88591Charset()
focal_class.modifier: public static final
focal_class.original_string: public static final Charset CHARSET_ISO_8859_1 = new ISO88591Charset();
focal_class.type: Charset
focal_class.var_name: CHARSET_ISO_8859_1
focal_class.declarator: CHARSET_ISO_8859_15 = new ISO885915Charset()
focal_class.modifier: public static final
focal_class.original_string: public static final Charset CHARSET_ISO_8859_15 = new ISO885915Charset();
focal_class.type: Charset
focal_class.var_name: CHARSET_ISO_8859_15
focal_class.declarator: CHARSET_GSM = new GSMCharset()
focal_class.modifier: public static final
focal_class.original_string: public static final Charset CHARSET_GSM = new GSMCharset();
focal_class.type: Charset
focal_class.var_name: CHARSET_GSM
focal_class.declarator: CHARSET_PACKED_GSM = new PackedGSMCharset()
focal_class.modifier: public static final
focal_class.original_string: public static final Charset CHARSET_PACKED_GSM = new PackedGSMCharset();
focal_class.type: Charset
focal_class.var_name: CHARSET_PACKED_GSM
focal_class.declarator: CHARSET_UCS_2 = new UCS2Charset()
focal_class.modifier: public static final
focal_class.original_string: public static final Charset CHARSET_UCS_2 = new UCS2Charset();
focal_class.type: Charset
focal_class.var_name: CHARSET_UCS_2
focal_class.declarator: CHARSET_UCS_2LE = new UCS2LECharset()
focal_class.modifier: public static final
focal_class.original_string: public static final Charset CHARSET_UCS_2LE = new UCS2LECharset();
focal_class.type: Charset
focal_class.var_name: CHARSET_UCS_2LE
focal_class.declarator: CHARSET_UTF_8 = new UTF8Charset()
focal_class.modifier: public static final
focal_class.original_string: public static final Charset CHARSET_UTF_8 = new UTF8Charset();
focal_class.type: Charset
focal_class.var_name: CHARSET_UTF_8
focal_class.declarator: CHARSET_MODIFIED_UTF8 = new ModifiedUTF8Charset()
focal_class.modifier: public static final
focal_class.original_string: public static final Charset CHARSET_MODIFIED_UTF8 = new ModifiedUTF8Charset();
focal_class.type: Charset
focal_class.var_name: CHARSET_MODIFIED_UTF8
focal_class.declarator: CHARSET_AIRWIDE_IA5 = new AirwideIA5Charset()
focal_class.modifier: public static final
focal_class.original_string: public static final Charset CHARSET_AIRWIDE_IA5 = new AirwideIA5Charset();
focal_class.type: Charset
focal_class.var_name: CHARSET_AIRWIDE_IA5
focal_class.declarator: CHARSET_VFD2_GSM = new VFD2GSMCharset()
focal_class.modifier: public static final
focal_class.original_string: public static final Charset CHARSET_VFD2_GSM = new VFD2GSMCharset();
focal_class.type: Charset
focal_class.var_name: CHARSET_VFD2_GSM
focal_class.declarator: CHARSET_VFTR_GSM = new VFTRGSMCharset()
focal_class.modifier: public static final
focal_class.original_string: public static final Charset CHARSET_VFTR_GSM = new VFTRGSMCharset();
focal_class.type: Charset
focal_class.var_name: CHARSET_VFTR_GSM
focal_class.declarator: CHARSET_GSM7 = CHARSET_PACKED_GSM
focal_class.modifier: public static final
focal_class.original_string: public static final Charset CHARSET_GSM7 = CHARSET_PACKED_GSM;
focal_class.type: Charset
focal_class.var_name: CHARSET_GSM7
focal_class.declarator: CHARSET_GSM8 = CHARSET_GSM
focal_class.modifier: public static final
focal_class.original_string: public static final Charset CHARSET_GSM8 = CHARSET_GSM;
focal_class.type: Charset
focal_class.var_name: CHARSET_GSM8
focal_class.declarator: CHARSET_AIRWIDE_GSM = CHARSET_AIRWIDE_IA5
focal_class.modifier: public static final
focal_class.original_string: public static final Charset CHARSET_AIRWIDE_GSM = CHARSET_AIRWIDE_IA5;
focal_class.type: Charset
focal_class.var_name: CHARSET_AIRWIDE_GSM
focal_class.declarator: CHARSET_TMOBILENL_GSM = new TMobileNlGSMCharset()
focal_class.modifier: public static final
focal_class.original_string: public static final Charset CHARSET_TMOBILENL_GSM = new TMobileNlGSMCharset();
focal_class.type: Charset
focal_class.var_name: CHARSET_TMOBILENL_GSM
focal_class.file: ch-commons-charset/src/main/java/com/cloudhopper/commons/charset/CharsetUtil.java
focal_class.identifier: CharsetUtil
focal_class.class_method_signature: CharsetUtil.getCharsetMap()
focal_class.full_signature: static public HashMap<String,Charset> getCharsetMap()
focal_class.identifier: getCharsetMap
focal_class.modifiers: static public
focal_class.parameters: ()
focal_class.return: HashMap<String,Charset>
focal_class.signature: HashMap<String,Charset> getCharsetMap()
focal_class.class_method_signature: CharsetUtil.map(String charsetName)
focal_class.full_signature: static public Charset map(String charsetName)
focal_class.identifier: map
focal_class.modifiers: static public
focal_class.parameters: (String charsetName)
focal_class.return: Charset
focal_class.signature: Charset map(String charsetName)
focal_class.class_method_signature: CharsetUtil.encode(CharSequence str0, String charsetName)
focal_class.full_signature: static public byte[] encode(CharSequence str0, String charsetName)
focal_class.identifier: encode
focal_class.modifiers: static public
focal_class.parameters: (CharSequence str0, String charsetName)
focal_class.return: byte[]
focal_class.signature: byte[] encode(CharSequence str0, String charsetName)
focal_class.class_method_signature: CharsetUtil.encode(CharSequence str0, Charset charset)
focal_class.full_signature: static public byte[] encode(CharSequence str0, Charset charset)
focal_class.identifier: encode
focal_class.modifiers: static public
focal_class.parameters: (CharSequence str0, Charset charset)
focal_class.return: byte[]
focal_class.signature: byte[] encode(CharSequence str0, Charset charset)
focal_class.class_method_signature: CharsetUtil.decode(byte[] bytes, StringBuilder buffer, String charsetName)
focal_class.full_signature: static public void decode(byte[] bytes, StringBuilder buffer, String charsetName)
focal_class.identifier: decode
focal_class.modifiers: static public
focal_class.parameters: (byte[] bytes, StringBuilder buffer, String charsetName)
focal_class.return: void
focal_class.signature: void decode(byte[] bytes, StringBuilder buffer, String charsetName)
focal_class.class_method_signature: CharsetUtil.decode(byte[] bytes, StringBuilder buffer, Charset charset)
focal_class.full_signature: static public void decode(byte[] bytes, StringBuilder buffer, Charset charset)
focal_class.identifier: decode
focal_class.modifiers: static public
focal_class.parameters: (byte[] bytes, StringBuilder buffer, Charset charset)
focal_class.return: void
focal_class.signature: void decode(byte[] bytes, StringBuilder buffer, Charset charset)
focal_class.class_method_signature: CharsetUtil.decode(byte[] bytes, String charsetName)
focal_class.full_signature: static public String decode(byte[] bytes, String charsetName)
focal_class.identifier: decode
focal_class.modifiers: static public
focal_class.parameters: (byte[] bytes, String charsetName)
focal_class.return: String
focal_class.signature: String decode(byte[] bytes, String charsetName)
focal_class.class_method_signature: CharsetUtil.decode(byte[] bytes, Charset charset)
focal_class.full_signature: static public String decode(byte[] bytes, Charset charset)
focal_class.identifier: decode
focal_class.modifiers: static public
focal_class.parameters: (byte[] bytes, Charset charset)
focal_class.return: String
focal_class.signature: String decode(byte[] bytes, Charset charset)
focal_class.class_method_signature: CharsetUtil.normalize(CharSequence str0, String charsetName)
focal_class.full_signature: static public String normalize(CharSequence str0, String charsetName)
focal_class.identifier: normalize
focal_class.modifiers: static public
focal_class.parameters: (CharSequence str0, String charsetName)
focal_class.return: String
focal_class.signature: String normalize(CharSequence str0, String charsetName)
focal_class.class_method_signature: CharsetUtil.normalize(CharSequence str0, Charset charset)
focal_class.full_signature: static public String normalize(CharSequence str0, Charset charset)
focal_class.identifier: normalize
focal_class.modifiers: static public
focal_class.parameters: (CharSequence str0, Charset charset)
focal_class.return: String
focal_class.signature: String normalize(CharSequence str0, Charset charset)
focal_method.body: static public String normalize(CharSequence str0, String charsetName) {
          Charset charset = map(charsetName);
          if (charset == null) {
              throw new IllegalArgumentException("Unsupported charset [" + charsetName + "]");
          }
          return normalize(str0, charset);
      }
focal_method.class_method_signature: CharsetUtil.normalize(CharSequence str0, String charsetName)
focal_method.full_signature: static public String normalize(CharSequence str0, String charsetName)
focal_method.identifier: normalize
focal_method.invocations: map normalize
focal_method.modifiers: static public
focal_method.parameters: (CharSequence str0, String charsetName)
focal_method.return: String
focal_method.signature: String normalize(CharSequence str0, String charsetName)