Here you can find the source of getCharset(String charsetName)
static public java.nio.charset.Charset getCharset(String charsetName)
//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*/ }