jAVA/JS 轉碼解碼(URLEncoder.encode decodeURIComponent)
引用包: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))));