Android学习札记9:对URL链接中中文汉字的编码处理

String url = null;
try {
	url = new String("http://open.client.lashou.com/api/detail/city/" + URLEncoder.encode(city.getName(), "utf8") + "/p/1");
} catch(Exception e) {
	e.printStackTrace();
}
return url;

你可能感兴趣的:(exception,android,String,url)