转译字符的方法:
1⃣️escape不编码字符有69个:,+,-,.,/,@,_,0-9,a-z,A-Z
2⃣️encodeURI不编码字符有82个:!,#,$,&,’,(,),,+,,,-,.,/,:,;,=,?,@,,~,0-9,a-z,A-Z
3⃣️encodeURIComponent不编码字符有71个:!, ',(,),*,-,.,,~,0-9,a-z,A-Z
在日常的开发中,使用encodeURIComponent()比较多,因为它可以将文、韩文等特殊字符转换成utf-8格式的url编码,所以如果给后台传递参数需要使用encodeURIComponent时需要后台解码对utf-8支持(form中的编码方式和当前页面编码方式相同)