Java Charset Create getCharset(int cpgid, int gcsgid)

Here you can find the source of getCharset(int cpgid, int gcsgid)

Description

get Charset

License

Apache License

Declaration

public static Charset getCharset(int cpgid, int gcsgid) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.nio.charset.Charset;

public class Main {
    public static final Charset CHARSET_IBM500 = Charset.forName("ibm500");

    public static Charset getCharset(int cpgid, int gcsgid) {
        Charset result;//w  w w. j  a v a2s. c o  m

        if (cpgid == 850)
            result = Charset.forName("ibm850");
        else if (cpgid == 500)
            result = CHARSET_IBM500;
        else if (cpgid == 1200)
            result = Charset.forName("UTF-16");
        else if (cpgid == 1252)
            result = Charset.forName("windows-1252");
        else if (cpgid == 1141)
            result = Charset.forName("CP1141");
        else {
            result = CHARSET_IBM500; // FIXME
        }

        return result;
    }
}

Related

  1. getCanonicalCharset(String charset)
  2. getCanonicalCharset(String charset)
  3. getCharset()
  4. getCharset()
  5. getCharset(int ibmCharacterSetId)
  6. getCharSet(String charset)
  7. getCharset(String charsetName)
  8. getCharset(String charsetName)