Here you can find the source of getCharset(String encoding)
public static Charset getCharset(String encoding)
//package com.java2s; //License from project: Apache License import java.nio.charset.Charset; public class Main { public final static String DEF_ENCODING = "UTF-8"; public static Charset getCharset(String encoding) { return ((null == encoding || "".equals(encoding.trim())) ? Charset.forName(DEF_ENCODING) : Charset.forName(encoding)); }/*from w w w .jav a 2 s. c om*/ }