博文

目前显示的是标签为“Escape”的博文

url encoding

Encode and Decode Encode Decode unEncode Unencode total encodeURIComponent :- >UTF-8 decodeURIComponent !, ‘,(,),*,-,.,_,~,0-9,a-z,A-Z 71 encodeURI :- > UTF-8 decodeURI !,#,$,&,’,(,),*,+,,,-,.,/,:,;,=,?,@,_,~,0-9,a-z,A-Z 82 escape :- > Unicode unescape  *,+,-,.,/,@,_,0-9,a-z,A-Z 69 javascript example :   encodeURIComponent in Javascript 1.5   alert(encodeURIComponent(" ö / ! * ( ) ' ")); Java example :        System.out.println("java.net.UrlEncoder(\"ö\",\"UTF8\"): =" +java.net.URLEncoder.encode("ö","UTF8"));       java.net.URLDecoder urlDecoder = new java.net.URLDecoder();        String s =  urlDecoder.decode("%D0%C5%CF%A2%CD%F8","gb2312");        System.out.println(s);        s =  urlDecoder.decode("D0%C5%CF%A2%CD%F8","utf8");        System.o...

Escape for XML & JSON

/**  * @author Jin  * @version 1.0.0  */ public class XmlTool {     public final static String JSONPARSE="forJSONparse";     public XmlTool() {         super();     }     /**      * Replace the five special characters by five "predefined entities".      * The XML specification defines five "predefined entities" representing special characters,      * and requires that tool honor them.The entities can be explicitly declared in a DTD.      * The table below lists the five XML predefined entities. The "Name" column mentions the entity's name. The "Character" column shows the character.      * <p>      * Name     Character      * quot     "      * amp     &   ...