加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

flex转码和解码

发布时间:2020-12-15 03:47:34 所属栏目:百科 来源:网络整理
导读:private function httpEncoding(param:String):String{??? //转码? ??? return encodeURIComponent(param);? }? private function openSelfStr(deleteStr:String):String{??? //解码? ??? return decodeURIComponent(deleteStr);? 在URL后面加?传递的参数里

private function httpEncoding(param:String):String{??? //转码?
??? return encodeURIComponent(param);?

}?

private function openSelfStr(deleteStr:String):String{??? //解码?
??? return decodeURIComponent(deleteStr);?

在URL后面加?传递的参数里有中文的时候,后台就取不到值。这时就需要对其进行转码?


Flex中转码的函数:escape,encodeURI,encodeURIComponent?
Flex中相应解码函数:unescape,decodeURI,decodeURIComponent?
一、escape对0-255以外的unicode值进行编码时输出%u****格式。?
其它情况下escape,encodeURI,encodeURIComponent编码结果相同。?
二、encodeURIComponent是将中文、韩文等特殊字符转换成utf-8格式的url编码,所以如果给后台传递参数需要使用encodeURIComponent时需要后台解码对utf-8支持?
PS:?
escape不编码字符有69个:*,+,-,.,/,@,_,0-9,a-z,A-Z?
encodeURI不编码字符有82个:!,#,$,&,',(,),*,+,,,-,.,/,:,;,=,?,@,_,~,0-9,a-z,A-Z?
encodeURIComponent不编码字符有71个:!, ',(,),*,-,.,_,~,0-9,a-z,A-Z?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读