Here you can find the source of decode(String value, Charset charset)
public static String decode(String value, Charset charset)
//package com.java2s; //License from project: Apache License import static java.nio.charset.StandardCharsets.*; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.nio.charset.Charset; public class Main { /** Uses URLDecoder to decode a application/x-www-form-urlencoded string, using the given Charset. */ public static String decode(String value, Charset charset) { try {/*ww w. ja v a 2 s .co m*/ return URLDecoder.decode(value, charset.name()); } catch (UnsupportedEncodingException ex) { throw new IllegalArgumentException("Characterset is not supported."); } } /** Uses URLDecoder to decode a application/x-www-form-urlencoded string, using UTF-8 as Charset. */ public static String decode(String value) { return decode(value, UTF_8); } }