解决 Flex navigateToURL 中文乱码问题
生活随笔
收集整理的這篇文章主要介紹了
解决 Flex navigateToURL 中文乱码问题
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
2019獨角獸企業重金招聘Python工程師標準>>>
場景:
flex做前端,servlet做后端,在flex中navigatetourl到一個servlet,但是url中如果包含中文,servlet獲取得到亂碼。
解決方案:
在flex代碼中:
naviageToURL(encodeURI(url));
在servlet中:
String para1=new String(request.getParameter(“para1″).getBytes(“iso-8859-1″),”UTF-8″);
或者:
String para1=new String(flex.messaging.util.URLDecoder.decode(request.getParameter(“para1″), “iso8859-1″).getBytes(“iso8859-1″),”utf-8″);
轉載于:https://my.oschina.net/liweigov/blog/63887
總結
以上是生活随笔為你收集整理的解决 Flex navigateToURL 中文乱码问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux Telnet远程登录
- 下一篇: The server sent a di