Here you can find the source of getEncoder(String charset)
public static CharsetEncoder getEncoder(String charset)
//package com.java2s; import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder; public class Main { public static CharsetEncoder getEncoder(String charset) { return Charset.forName(charset).newEncoder(); }/*from ww w . j a va 2 s .c o m*/ }