代码如下://把编码转换成 gb2312编码 function UrlEncode(str) { var i, c, ret="", strSpecial="!\"#$%&()*+,/:;<=>?@[\]^`{|}~%"; for(i = 0; i < str.length; i++) { //alert(str.charCodeAt(i)); c = str.charAt(i); if(c==" ") ret+="+"; else if(strSpecial.indexOf(c)!=-1) ret += "%" + str.charCodeAt(i).toString(16); if(z[str.charCodeAt(i)] != null) { d = z[str.charCodeAt(i)]; try { ret += "%...