Loading

javascript与java编码互转


java:
java.net.URLEncoder.encode(s, "UTF-8");
java.net.URLDecoder.decode(chezhanInEn,"UTF-8");
str.replaceAll("%", "-")

javaScript:
encodeURI(cz);
decodeURI(cz);
str.replace(/-/g,"%");

 

posted @ 2015-08-31 11:20  stono  阅读(2123)  评论(0编辑  收藏  举报