Java Utililty Methods Charset Create

List of utility methods to do Charset Create

Description

The list of methods to do Charset Create are organized into topic(s).

Method

StringgetCanonicalCharset(String charset)
get Canonical Charset
return Charset.forName(charset).name();
StringgetCanonicalCharset(String charset)
get Canonical Charset
return Charset.forName(charset).name();
CharsetgetCharset()
get Charset
return _charset;
CharsetgetCharset()
Gets the charset used by the write method.
return charset;
CharsetgetCharset(int cpgid, int gcsgid)
get Charset
Charset result;
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)
...
CharsetgetCharset(int ibmCharacterSetId)

Returns the Charset#name() associated with the given ibmCharacterSetId

Associations are defined by Charset#aliases() ; special cases are defined by IBM Websphere MQ Infocenter - Character set identifiers

Charset charset;
switch (ibmCharacterSetId) {
case IBM_CHARACTER_SET_ID_UNICODE:
    charset = UNICODE;
    break;
case IBM_CHARACTER_SET_ID_UTF8:
    charset = UTF8;
    break;
...
CharsetgetCharSet(String charset)
get Char Set
return Charset.forName(charset);
java.nio.charset.CharsetgetCharset(String charsetName)
get Charset
if (charsetName == null)
    return StandardCharsets.UTF_8;
return java.nio.charset.Charset.forName(charsetName);
CharsetgetCharset(String charsetName)
get Charset
Charset charset = Charset.forName(charsetName);
CHARSET_CACHE.put(charsetName, charset);
return charset;
StringgetCharset(String contentType)
get Charset
Matcher matcher = patternForCharset.matcher(contentType);
if (matcher.find()) {
    String charset = matcher.group(1);
    if (Charset.isSupported(charset)) {
        return charset;
return null;
...