且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android - 如何在Android中将字符串转换为utf-8

更新时间:2023-09-11 23:07:34

http://developer.android.com/reference/java/net/URLEncoder.html 你可以读到你所使用的已被弃用,你应该使用 static String encode(String s,String charsetName)

In http://developer.android.com/reference/java/net/URLEncoder.html you can read that the you used is deprecated and that you should use static String encode(String s, String charsetName)

所以 URLEncoder.encode(台北市,utf-8)应该这样做。