现在的位置: 首页 > 综合 > 正文

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

2018年04月04日 ⁄ 综合 ⁄ 共 181字 ⁄ 字号 评论关闭
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;

抱歉!评论已关闭.