Java Charset Create getCharset(String charsetName)

Here you can find the source of getCharset(String charsetName)

Description

get Charset

License

Apache License

Declaration

static public java.nio.charset.Charset getCharset(String charsetName) 

Method Source Code

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

import java.nio.charset.StandardCharsets;

public class Main {
    static public java.nio.charset.Charset getCharset(String charsetName) {
        if (charsetName == null)
            return StandardCharsets.UTF_8;
        return java.nio.charset.Charset.forName(charsetName);
    }/*from   w  ww  .  ja  va2s  .  co m*/
}

Related

  1. getCharset()
  2. getCharset()
  3. getCharset(int cpgid, int gcsgid)
  4. getCharset(int ibmCharacterSetId)
  5. getCharSet(String charset)
  6. getCharset(String charsetName)
  7. getCharset(String contentType)
  8. getCharset(String enc)
  9. getCharset(String encoding)