Deprecated. The resulting string may vary depending on the platform's default encoding. Instead, use the encode(String,String) method to specify the encoding.这个没什么为什么的吧,看一下api不就明白了 默认的编码可能会依赖于平台,所以被deprecated了,用encode(String,String)代替,也就是需要指定编码方式,这样跨平台时结果也一样了
改成URLEncoder.encode(name,"utf-8")
就不过时了。谁解释下?
默认的编码可能会依赖于平台,所以被deprecated了,用encode(String,String)代替,也就是需要指定编码方式,这样跨平台时结果也一样了