java.net.URLEncoder与java.net.URLDecoder

URLEncoder

方法 名称
static String encode(String s) 已过时。 结果字符串可能会有所不同,具体取决于平台的默认编码。而是使用encode(String,String)方法指定编码。
static String encode(String s, String enc) application/x-www-form-urlencoded 使用特定编码方案将字符串转换为格式。enc(utf-8)

URLDecoder

方法 描述
static String decode(String s) 已过时。
结果字符串可能会有所不同,具体取决于平台的默认编码。而是使用decode(String,String)方法指定编码。
static String decode(String s, String enc) application/x-www-form-urlencoded使用特定编码方案对字符串进行解码。

猜你喜欢

转载自blog.csdn.net/qq_27870421/article/details/90110900