扫码关注官方订阅号
欢迎选择我的课程,让我们一起见证您的进步~~
两端用unicode或者urlencode一下避免中文不就可以了
你转换转错了吧,服务器给你的是gbk,要转utf-8,应该是new String(str.getBytes("gbk"), "utf-8");另外,普遍的转换方式是new String(result.getBytes("ISO-8859-1"), "UTF-8");
new String(str.getBytes("gbk"), "utf-8");
new String(result.getBytes("ISO-8859-1"), "UTF-8");
我觉得不管get还是post中map等中 中文应该统一urlencode编码下 一行代码的事情。
二楼 的方法试试。。估计编码顺序 颠倒了。
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
两端用unicode或者urlencode一下避免中文不就可以了
你转换转错了吧,服务器给你的是gbk,要转utf-8,应该是
new String(str.getBytes("gbk"), "utf-8");另外,普遍的转换方式是new String(result.getBytes("ISO-8859-1"), "UTF-8");我觉得不管get还是post中map等中 中文应该统一urlencode编码下 一行代码的事情。
二楼 的方法试试。。估计编码顺序 颠倒了。