Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   /*
    * Licensed to the Apache Software Foundation (ASF) under one or more
    * contributor license agreements.  See the NOTICE file distributed with
    * this work for additional information regarding copyright ownership.
    * The ASF licenses this file to You under the Apache License, Version 2.0
    * (the "License"); you may not use this file except in compliance with
    * the License.  You may obtain a copy of the License at
    * 
    *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation and was
   * originally based on software copyright (c) 1999, International
   * Business Machines, Inc., http://www.apache.org.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.jasper.xmlparser;
  
EncodingMap is a convenience class which handles conversions between IANA encoding names and Java encoding names, and vice versa. The encoding names used in XML instance documents must be the IANA encoding names specified or one of the aliases for those names which IANA defines.

Common Name

Use this name in XML files

Name Type

Xerces converts to this Java Encoder Name

8 bit Unicode

UTF-8

IANA

UTF8

ISO Latin 1

ISO-8859-1

MIME

ISO-8859-1

ISO Latin 2

ISO-8859-2

MIME

ISO-8859-2

ISO Latin 3

ISO-8859-3

MIME

ISO-8859-3

ISO Latin 4

ISO-8859-4

MIME

ISO-8859-4

ISO Latin Cyrillic

ISO-8859-5

MIME

ISO-8859-5

ISO Latin Arabic

ISO-8859-6

MIME

ISO-8859-6

ISO Latin Greek

ISO-8859-7

MIME

ISO-8859-7

ISO Latin Hebrew

ISO-8859-8

MIME

ISO-8859-8

ISO Latin 5

ISO-8859-9

MIME

ISO-8859-9

EBCDIC: US

ebcdic-cp-us

IANA

cp037

EBCDIC: Canada

ebcdic-cp-ca

IANA

cp037

EBCDIC: Netherlands

ebcdic-cp-nl

IANA

cp037

EBCDIC: Denmark

ebcdic-cp-dk

IANA

cp277

EBCDIC: Norway

ebcdic-cp-no

IANA

cp277

EBCDIC: Finland

ebcdic-cp-fi

IANA

cp278

EBCDIC: Sweden

ebcdic-cp-se

IANA

cp278

EBCDIC: Italy

ebcdic-cp-it

IANA

cp280

EBCDIC: Spain, Latin America

ebcdic-cp-es

IANA

cp284

EBCDIC: Great Britain

ebcdic-cp-gb

IANA

cp285

EBCDIC: France

ebcdic-cp-fr

IANA

cp297

EBCDIC: Arabic

ebcdic-cp-ar1

IANA

cp420

EBCDIC: Hebrew

ebcdic-cp-he

IANA

cp424

EBCDIC: Switzerland

ebcdic-cp-ch

IANA

cp500

EBCDIC: Roece

ebcdic-cp-roece

IANA

cp870

EBCDIC: Yugoslavia

ebcdic-cp-yu

IANA

cp870

EBCDIC: Iceland

ebcdic-cp-is

IANA

cp871

EBCDIC: Urdu

ebcdic-cp-ar2

IANA

cp918

Chinese for PRC, mixed 1/2 byte

gb2312

MIME

GB2312

Extended Unix Code, packed for Japanese

euc-jp

MIME

eucjis

Japanese: iso-2022-jp

iso-2020-jp

MIME

JIS

Japanese: Shift JIS

Shift_JIS

MIME

SJIS

Chinese: Big5

Big5

MIME

Big5

Extended Unix Code, packed for Korean

euc-kr

MIME

iso2022kr

Cyrillic

koi8-r

MIME

koi8-r

Author(s):
TAMURA Kent, IBM
Andy Clark, IBM
Version:
$Id: EncodingMap.java 515 2008-03-17 21:02:23Z jfrederic.clere@jboss.com $
 
 public class EncodingMap {
 
     //
     // Data
     //
 
    
fIANA2JavaMap
 
     protected final static Hashtable fIANA2JavaMap = new Hashtable();

    
fJava2IANAMap
 
     protected final static Hashtable fJava2IANAMap = new Hashtable();
 
     //
     // Static initialization
     //
 
     static {
 
         // add IANA to Java encoding mappings.
         .put("BIG5",            "Big5");
         .put("CSBIG5",            "Big5");
         .put("CP037",    "CP037");
         .put("IBM037",    "CP037");
         .put("CSIBM037",    "CP037");
         .put("EBCDIC-CP-US",    "CP037");
         .put("EBCDIC-CP-CA",    "CP037");
         .put("EBCDIC-CP-NL",    "CP037");
         .put("EBCDIC-CP-WT",    "CP037");
         .put("IBM273",    "CP273");
         .put("CP273",    "CP273");
         .put("CSIBM273",    "CP273");
         .put("IBM277",    "CP277");
         .put("CP277",    "CP277");
         .put("CSIBM277",    "CP277");
         .put("EBCDIC-CP-DK",    "CP277");
         .put("EBCDIC-CP-NO",    "CP277");
         .put("IBM278",    "CP278");
         .put("CP278",    "CP278");
         .put("CSIBM278",    "CP278");
         .put("EBCDIC-CP-FI",    "CP278");
         .put("EBCDIC-CP-SE",    "CP278");
         .put("IBM280",    "CP280");
         .put("CP280",    "CP280");
         .put("CSIBM280",    "CP280");
         .put("EBCDIC-CP-IT",    "CP280");
         .put("IBM284",    "CP284");
         .put("CP284",    "CP284");
         .put("CSIBM284",    "CP284");
         .put("EBCDIC-CP-ES",    "CP284");
         .put("EBCDIC-CP-GB",    "CP285");
         .put("IBM285",    "CP285");
         .put("CP285",    "CP285");
         .put("CSIBM285",    "CP285");
         .put("EBCDIC-JP-KANA",    "CP290");
         .put("IBM290",    "CP290");
         .put("CP290",    "CP290");
         .put("CSIBM290",    "CP290");
         .put("EBCDIC-CP-FR",    "CP297");
         .put("IBM297",    "CP297");
         .put("CP297",    "CP297");
         .put("CSIBM297",    "CP297");
         .put("EBCDIC-CP-AR1",   "CP420");
         .put("IBM420",    "CP420");
         .put("CP420",    "CP420");
         .put("CSIBM420",    "CP420");
         .put("EBCDIC-CP-HE",    "CP424");
         .put("IBM424",    "CP424");
         .put("CP424",    "CP424");
         .put("CSIBM424",    "CP424");
         .put("IBM437",    "CP437");
         .put("437",    "CP437");
         .put("CP437",    "CP437");
         .put("CSPC8CODEPAGE437",    "CP437");
         .put("EBCDIC-CP-CH",    "CP500");
         .put("IBM500",    "CP500");
         .put("CP500",    "CP500");
         .put("CSIBM500",    "CP500");
         .put("EBCDIC-CP-CH",    "CP500");
         .put("EBCDIC-CP-BE",    "CP500"); 
         .put("IBM775",    "CP775");
         .put("CP775",    "CP775");
         .put("CSPC775BALTIC",    "CP775");
         .put("IBM850",    "CP850");
         .put("850",    "CP850");
         .put("CP850",    "CP850");
         .put("CSPC850MULTILINGUAL",    "CP850");
         .put("IBM852",    "CP852");
         .put("852",    "CP852");
         .put("CP852",    "CP852");
         .put("CSPCP852",    "CP852");
         .put("IBM855",    "CP855");
         .put("855",    "CP855");
         .put("CP855",    "CP855");
         .put("CSIBM855",    "CP855");
         .put("IBM857",    "CP857");
         .put("857",    "CP857");
         .put("CP857",    "CP857");
         .put("CSIBM857",    "CP857");
         .put("IBM00858",    "CP858");
         .put("CP00858",    "CP858");
         .put("CCSID00858",    "CP858");
         .put("IBM860",    "CP860");
         .put("860",    "CP860");
         .put("CP860",    "CP860");
         .put("CSIBM860",    "CP860");
         .put("IBM861",    "CP861");
         .put("861",    "CP861");
         .put("CP861",    "CP861");
         .put("CP-IS",    "CP861");
         .put("CSIBM861",    "CP861");
         .put("IBM862",    "CP862");
         .put("862",    "CP862");
         .put("CP862",    "CP862");
         .put("CSPC862LATINHEBREW",    "CP862");
         .put("IBM863",    "CP863");
         .put("863",    "CP863");
         .put("CP863",    "CP863");
         .put("CSIBM863",    "CP863");
         .put("IBM864",    "CP864");
         .put("CP864",    "CP864");
         .put("CSIBM864",    "CP864");
         .put("IBM865",    "CP865");
         .put("865",    "CP865");
         .put("CP865",    "CP865");
         .put("CSIBM865",    "CP865");
         .put("IBM866",    "CP866");
         .put("866",    "CP866");
         .put("CP866",    "CP866");
         .put("CSIBM866",    "CP866");
         .put("IBM868",    "CP868");
         .put("CP868",    "CP868");
         .put("CSIBM868",    "CP868");
         .put("CP-AR",        "CP868");
         .put("IBM869",    "CP869");
         .put("CP869",    "CP869");
         .put("CSIBM869",    "CP869");
         .put("CP-GR",        "CP869");
         .put("IBM870",    "CP870");
         .put("CP870",    "CP870");
         .put("CSIBM870",    "CP870");
         .put("EBCDIC-CP-ROECE""CP870");
         .put("EBCDIC-CP-YU",    "CP870");
         .put("IBM871",    "CP871");
         .put("CP871",    "CP871");
         .put("CSIBM871",    "CP871");
         .put("EBCDIC-CP-IS",    "CP871");
         .put("IBM918",    "CP918");
         .put("CP918",    "CP918");
         .put("CSIBM918",    "CP918");
         .put("EBCDIC-CP-AR2",   "CP918");
         .put("IBM00924",    "CP924");
         .put("CP00924",    "CP924");
         .put("CCSID00924",    "CP924");
         // is this an error???
         .put("EBCDIC-LATIN9--EURO",    "CP924");
         .put("IBM1026",    "CP1026");
         .put("CP1026",    "CP1026");
         .put("CSIBM1026",    "CP1026");
         .put("IBM01140",    "Cp1140");
         .put("CP01140",    "Cp1140");
         .put("CCSID01140",    "Cp1140");
         .put("IBM01141",    "Cp1141");
         .put("CP01141",    "Cp1141");
         .put("CCSID01141",    "Cp1141");
         .put("IBM01142",    "Cp1142");
         .put("CP01142",    "Cp1142");
         .put("CCSID01142",    "Cp1142");
         .put("IBM01143",    "Cp1143");
         .put("CP01143",    "Cp1143");
         .put("CCSID01143",    "Cp1143");
         .put("IBM01144",    "Cp1144");
         .put("CP01144",    "Cp1144");
         .put("CCSID01144",    "Cp1144");
         .put("IBM01145",    "Cp1145");
         .put("CP01145",    "Cp1145");
         .put("CCSID01145",    "Cp1145");
         .put("IBM01146",    "Cp1146");
         .put("CP01146",    "Cp1146");
         .put("CCSID01146",    "Cp1146");
         .put("IBM01147",    "Cp1147");
         .put("CP01147",    "Cp1147");
         .put("CCSID01147",    "Cp1147");
         .put("IBM01148",    "Cp1148");
         .put("CP01148",    "Cp1148");
         .put("CCSID01148",    "Cp1148");
         .put("IBM01149",    "Cp1149");
         .put("CP01149",    "Cp1149");
         .put("CCSID01149",    "Cp1149");
         .put("EUC-JP",          "EUCJIS");
         .put("CSEUCPKDFMTJAPANESE",          "EUCJIS");
         .put("EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE",          "EUCJIS");
         .put("EUC-KR",          "KSC5601");
         .put("CSEUCKR",          "KSC5601");
         .put("KS_C_5601-1987",          "KS_C_5601-1987");
         .put("ISO-IR-149",          "KS_C_5601-1987");
         .put("KS_C_5601-1989",          "KS_C_5601-1987");
         .put("KSC_5601",          "KS_C_5601-1987");
         .put("KOREAN",          "KS_C_5601-1987");
         .put("CSKSC56011987",          "KS_C_5601-1987");
         .put("GB2312",          "GB2312");
         .put("CSGB2312",          "GB2312");
         .put("ISO-2022-JP",     "JIS");
         .put("CSISO2022JP",     "JIS");
         .put("ISO-2022-KR",     "ISO2022KR");
         .put("CSISO2022KR",     "ISO2022KR");
         .put("ISO-2022-CN",     "ISO2022CN");
 
         .put("X0201",  "JIS0201");
         .put("CSISO13JISC6220JP""JIS0201");
         .put("X0208",  "JIS0208");
         .put("ISO-IR-87",  "JIS0208");
         .put("X0208dbiJIS_X0208-1983",  "JIS0208");
         .put("CSISO87JISX0208",  "JIS0208");
         .put("X0212",  "JIS0212");
         .put("ISO-IR-159",  "JIS0212");
         .put("CSISO159JISX02121990",  "JIS0212");
         .put("GB18030",       "GB18030");
         .put("GBK",       "GBK");
         .put("CP936",       "GBK");
         .put("MS936",       "GBK");
         .put("WINDOWS-936",       "GBK");
         .put("SHIFT_JIS",       "SJIS");
         .put("CSSHIFTJIS",       "SJIS");
         .put("MS_KANJI",       "SJIS");
         .put("WINDOWS-31J",       "MS932");
         .put("CSWINDOWS31J",       "MS932");
 
 	    // Add support for Cp1252 and its friends
         .put("WINDOWS-1250",   "Cp1250");
         .put("WINDOWS-1251",   "Cp1251");
         .put("WINDOWS-1252",   "Cp1252");
         .put("WINDOWS-1253",   "Cp1253");
         .put("WINDOWS-1254",   "Cp1254");
         .put("WINDOWS-1255",   "Cp1255");
         .put("WINDOWS-1256",   "Cp1256");
         .put("WINDOWS-1257",   "Cp1257");
         .put("WINDOWS-1258",   "Cp1258");
         .put("TIS-620",   "TIS620");
 
         .put("ISO-8859-1",      "ISO8859_1"); 
         .put("ISO-IR-100",      "ISO8859_1");
         .put("ISO_8859-1",      "ISO8859_1");
         .put("LATIN1",      "ISO8859_1");
         .put("CSISOLATIN1",      "ISO8859_1");
         .put("L1",      "ISO8859_1");
         .put("IBM819",      "ISO8859_1");
         .put("CP819",      "ISO8859_1");
 
         .put("ISO-8859-2",      "ISO8859_2"); 
         .put("ISO-IR-101",      "ISO8859_2");
         .put("ISO_8859-2",      "ISO8859_2");
         .put("LATIN2",      "ISO8859_2");
         .put("CSISOLATIN2",      "ISO8859_2");
         .put("L2",      "ISO8859_2");
 
         .put("ISO-8859-3",      "ISO8859_3"); 
         .put("ISO-IR-109",      "ISO8859_3");
         .put("ISO_8859-3",      "ISO8859_3");
         .put("LATIN3",      "ISO8859_3");
         .put("CSISOLATIN3",      "ISO8859_3");
         .put("L3",      "ISO8859_3");
 
         .put("ISO-8859-4",      "ISO8859_4"); 
         .put("ISO-IR-110",      "ISO8859_4");
         .put("ISO_8859-4",      "ISO8859_4");
         .put("LATIN4",      "ISO8859_4");
         .put("CSISOLATIN4",      "ISO8859_4");
         .put("L4",      "ISO8859_4");
 
         .put("ISO-8859-5",      "ISO8859_5"); 
         .put("ISO-IR-144",      "ISO8859_5");
         .put("ISO_8859-5",      "ISO8859_5");
         .put("CYRILLIC",      "ISO8859_5");
         .put("CSISOLATINCYRILLIC",      "ISO8859_5");
 
         .put("ISO-8859-6",      "ISO8859_6"); 
         .put("ISO-IR-127",      "ISO8859_6");
         .put("ISO_8859-6",      "ISO8859_6");
         .put("ECMA-114",      "ISO8859_6");
         .put("ASMO-708",      "ISO8859_6");
         .put("ARABIC",      "ISO8859_6");
         .put("CSISOLATINARABIC",      "ISO8859_6");
 
         .put("ISO-8859-7",      "ISO8859_7"); 
         .put("ISO-IR-126",      "ISO8859_7");
         .put("ISO_8859-7",      "ISO8859_7");
         .put("ELOT_928",      "ISO8859_7");
         .put("ECMA-118",      "ISO8859_7");
         .put("GREEK",      "ISO8859_7");
         .put("CSISOLATINGREEK",      "ISO8859_7");
         .put("GREEK8",      "ISO8859_7");
 
         .put("ISO-8859-8",      "ISO8859_8"); 
         .put("ISO-8859-8-I",      "ISO8859_8"); // added since this encoding only differs w.r.t. presentation 
         .put("ISO-IR-138",      "ISO8859_8");
         .put("ISO_8859-8",      "ISO8859_8");
         .put("HEBREW",      "ISO8859_8");
         .put("CSISOLATINHEBREW",      "ISO8859_8");
 
         .put("ISO-8859-9",      "ISO8859_9"); 
         .put("ISO-IR-148",      "ISO8859_9");
         .put("ISO_8859-9",      "ISO8859_9");
         .put("LATIN5",      "ISO8859_9");
         .put("CSISOLATIN5",      "ISO8859_9");
         .put("L5",      "ISO8859_9");
 
         .put("ISO-8859-13",      "ISO8859_13"); 
         
         .put("ISO-8859-15",      "ISO8859_15_FDIS"); 
         .put("ISO_8859-15",      "ISO8859_15_FDIS");
         .put("LATIN-9",          "ISO8859_15_FDIS"); 
 
         .put("KOI8-R",          "KOI8_R");
         .put("CSKOI8R",          "KOI8_R");
         .put("US-ASCII",        "ASCII"); 
         .put("ISO-IR-6",        "ASCII");
         .put("ANSI_X3.4-1968",        "ASCII");
         .put("ANSI_X3.4-1986",        "ASCII");
         .put("ISO_646.IRV:1991",        "ASCII");
         .put("ASCII",        "ASCII");
         .put("CSASCII",        "ASCII");
         .put("ISO646-US",        "ASCII");
         .put("US",        "ASCII");
         .put("IBM367",        "ASCII");
         .put("CP367",        "ASCII");
         .put("UTF-8",           "UTF8");
         .put("UTF-16",           "UTF-16");
         .put("UTF-16BE",           "UnicodeBig");
         .put("UTF-16LE",           "UnicodeLittle");
 
         // support for 1047, as proposed to be added to the 
         // IANA registry in 
         // http://lists.w3.org/Archives/Public/ietf-charset/2002JulSep/0049.html
         .put("IBM-1047",    "Cp1047");
         .put("IBM1047",    "Cp1047");
         .put("CP1047",    "Cp1047");
 
         // Adding new aliases as proposed in
         // http://lists.w3.org/Archives/Public/ietf-charset/2002JulSep/0058.html
         .put("IBM-37",    "CP037");
         .put("IBM-273",    "CP273");
         .put("IBM-277",    "CP277");
         .put("IBM-278",    "CP278");
         .put("IBM-280",    "CP280");
         .put("IBM-284",    "CP284");
         .put("IBM-285",    "CP285");
         .put("IBM-290",    "CP290");
         .put("IBM-297",    "CP297");
         .put("IBM-420",    "CP420");
         .put("IBM-424",    "CP424");
         .put("IBM-437",    "CP437");
         .put("IBM-500",    "CP500");
         .put("IBM-775",    "CP775");
         .put("IBM-850",    "CP850");
         .put("IBM-852",    "CP852");
         .put("IBM-855",    "CP855");
         .put("IBM-857",    "CP857");
         .put("IBM-858",    "CP858");
         .put("IBM-860",    "CP860");
         .put("IBM-861",    "CP861");
         .put("IBM-862",    "CP862");
         .put("IBM-863",    "CP863");
         .put("IBM-864",    "CP864");
         .put("IBM-865",    "CP865");
         .put("IBM-866",    "CP866");
         .put("IBM-868",    "CP868");
         .put("IBM-869",    "CP869");
         .put("IBM-870",    "CP870");
         .put("IBM-871",    "CP871");
         .put("IBM-918",    "CP918");
         .put("IBM-924",    "CP924");
         .put("IBM-1026",    "CP1026");
         .put("IBM-1140",    "Cp1140");
         .put("IBM-1141",    "Cp1141");
         .put("IBM-1142",    "Cp1142");
         .put("IBM-1143",    "Cp1143");
         .put("IBM-1144",    "Cp1144");
         .put("IBM-1145",    "Cp1145");
         .put("IBM-1146",    "Cp1146");
         .put("IBM-1147",    "Cp1147");
         .put("IBM-1148",    "Cp1148");
         .put("IBM-1149",    "Cp1149");
         .put("IBM-819",      "ISO8859_1");
         .put("IBM-367",        "ASCII");
 
         // REVISIT:
         //   j:CNS11643 -> EUC-TW?
         //   ISO-2022-CN? ISO-2022-CN-EXT?
                                                 
         // add Java to IANA encoding mappings
         //fJava2IANAMap.put("8859_1",    "US-ASCII"); // ?
         .put("ISO8859_1",    "ISO-8859-1");
         .put("ISO8859_2",    "ISO-8859-2");
         .put("ISO8859_3",    "ISO-8859-3");
         .put("ISO8859_4",    "ISO-8859-4");
         .put("ISO8859_5",    "ISO-8859-5");
         .put("ISO8859_6",    "ISO-8859-6");
         .put("ISO8859_7",    "ISO-8859-7");
         .put("ISO8859_8",    "ISO-8859-8");
         .put("ISO8859_9",    "ISO-8859-9");
         .put("ISO8859_13",    "ISO-8859-13");
         .put("ISO8859_15",    "ISO-8859-15");
         .put("ISO8859_15_FDIS",    "ISO-8859-15");
         .put("Big5",      "BIG5");
         .put("CP037",     "EBCDIC-CP-US");
         .put("CP273",     "IBM273");
         .put("CP277",     "EBCDIC-CP-DK");
         .put("CP278",     "EBCDIC-CP-FI");
         .put("CP280",     "EBCDIC-CP-IT");
         .put("CP284",     "EBCDIC-CP-ES");
         .put("CP285",     "EBCDIC-CP-GB");
         .put("CP290",     "EBCDIC-JP-KANA");
         .put("CP297",     "EBCDIC-CP-FR");
         .put("CP420",     "EBCDIC-CP-AR1");
         .put("CP424",     "EBCDIC-CP-HE");
         .put("CP437",     "IBM437");
         .put("CP500",     "EBCDIC-CP-CH");
         .put("CP775",     "IBM775");
         .put("CP850",     "IBM850");
         .put("CP852",     "IBM852");
         .put("CP855",     "IBM855");
         .put("CP857",     "IBM857");
         .put("CP858",     "IBM00858");
         .put("CP860",     "IBM860");
         .put("CP861",     "IBM861");
         .put("CP862",     "IBM862");
         .put("CP863",     "IBM863");
         .put("CP864",     "IBM864");
         .put("CP865",     "IBM865");
         .put("CP866",     "IBM866");
         .put("CP868",     "IBM868");
         .put("CP869",     "IBM869");
         .put("CP870",     "EBCDIC-CP-ROECE");
         .put("CP871",     "EBCDIC-CP-IS");
         .put("CP918",     "EBCDIC-CP-AR2");
         .put("CP924",     "IBM00924");
         .put("CP1026",     "IBM1026");
         .put("Cp01140",     "IBM01140");
         .put("Cp01141",     "IBM01141");
         .put("Cp01142",     "IBM01142");
         .put("Cp01143",     "IBM01143");
         .put("Cp01144",     "IBM01144");
         .put("Cp01145",     "IBM01145");
         .put("Cp01146",     "IBM01146");
         .put("Cp01147",     "IBM01147");
         .put("Cp01148",     "IBM01148");
         .put("Cp01149",     "IBM01149");
         .put("EUCJIS",    "EUC-JP");
         .put("KS_C_5601-1987",          "KS_C_5601-1987");
         .put("GB2312",    "GB2312");
         .put("ISO2022KR""ISO-2022-KR");
         .put("ISO2022CN""ISO-2022-CN");
         .put("JIS",       "ISO-2022-JP");
         .put("KOI8_R",    "KOI8-R");
         .put("KSC5601",   "EUC-KR");
         .put("GB18030",      "GB18030");
         .put("GBK",       "GBK");
         .put("SJIS",      "SHIFT_JIS");
         .put("MS932",      "WINDOWS-31J");
         .put("UTF8",      "UTF-8");
         .put("Unicode",   "UTF-16");
         .put("UnicodeBig",   "UTF-16BE");
         .put("UnicodeLittle",   "UTF-16LE");
         .put("JIS0201",  "X0201");
         .put("JIS0208",  "X0208");
         .put("JIS0212",  "ISO-IR-159");
 
         // proposed addition (see above for details):
         .put("CP1047",    "IBM1047");
 
     } // <clinit>()
 
     //
     // Constructors
     //
 
    
Default constructor.
 
     public EncodingMap() {}
 
     //
     // Public static methods
     //
 
    
Adds an IANA to Java encoding name mapping.

Parameters:
ianaEncoding The IANA encoding name.
javaEncoding The Java encoding name.
 
     public static void putIANA2JavaMapping(String ianaEncoding
                                            String javaEncoding) {
         .put(ianaEncodingjavaEncoding);
     } // putIANA2JavaMapping(String,String)
 
    
Returns the Java encoding name for the specified IANA encoding name.

Parameters:
ianaEncoding The IANA encoding name.
 
     public static String getIANA2JavaMapping(String ianaEncoding) {
         return (String).get(ianaEncoding);
     } // getIANA2JavaMapping(String):String
 
    
Removes an IANA to Java encoding name mapping.

Parameters:
ianaEncoding The IANA encoding name.
 
     public static String removeIANA2JavaMapping(String ianaEncoding) {
         return (String).remove(ianaEncoding);
     } // removeIANA2JavaMapping(String):String
 
    
Adds a Java to IANA encoding name mapping.

Parameters:
javaEncoding The Java encoding name.
ianaEncoding The IANA encoding name.
 
     public static void putJava2IANAMapping(String javaEncoding
                                            String ianaEncoding) {
         .put(javaEncodingianaEncoding);
    } // putJava2IANAMapping(String,String)

    
Returns the IANA encoding name for the specified Java encoding name.

Parameters:
javaEncoding The Java encoding name.
    public static String getJava2IANAMapping(String javaEncoding) {
        return (String).get(javaEncoding);
    } // getJava2IANAMapping(String):String

    
Removes a Java to IANA encoding name mapping.

Parameters:
javaEncoding The Java encoding name.
    public static String removeJava2IANAMapping(String javaEncoding) {
        return (String).remove(javaEncoding);
    } // removeJava2IANAMapping
// class EncodingMap
New to GrepCode? Check out our FAQ X