引用包:import java.net.URLDecoder;
Java解码:
String s = URLDecoder.decode(URLDecoder.decode(templateObj.getString("templateContent"), "UTF-8"),"UTF-8");
s = URLDecoder.decode(URLDecoder.decode(s, "UTF-8"),"UTF-8");
Java转码:
URLEncoder.encode(name,"UTF-8");
JS转码:
tplData['templateContent'] =encodeURIComponent(encodeURIComponent(encodeURIComponent(encodeURIComponent(tempItemData['templateContent']))));
JS解码:
var originalTemplateContent = decodeURIComponent(decodeURIComponent(decodeURIComponent(decodeURIComponent(templateData.originalTemplateContent))));
Java解码:
String s = URLDecoder.decode(URLDecoder.decode(templateObj.getString("templateContent"), "UTF-8"),"UTF-8");
s = URLDecoder.decode(URLDecoder.decode(s, "UTF-8"),"UTF-8");
Java转码:
URLEncoder.encode(name,"UTF-8");
JS转码:
tplData['templateContent'] =encodeURIComponent(encodeURIComponent(encodeURIComponent(encodeURIComponent(tempItemData['templateContent']))));
JS解码:
var originalTemplateContent = decodeURIComponent(decodeURIComponent(decodeURIComponent(decodeURIComponent(templateData.originalTemplateContent))));