Java Charset get CharsetDecoder
import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; public class Main { public static void main(String[] argv) throws Exception { //from ww w . j a v a 2 s.c o m CharsetDecoder de= Charset.defaultCharset().newDecoder(); System.out.println(de.replacement()); } }