源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

Python和php通信乱码问题解决方法

  • 时间:2020-12-25 10:34 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:Python和php通信乱码问题解决方法
即使在urlencode之前str.decode(“cp936″).encode(“utf-8″)做了编码转换也是没用的。后来查询手册查到一个urllib.quote()函数,用此方法成功解决! python端:
[u]复制代码[/u] 代码如下:
str = "中文" str = urllib.quote(str.decode("cp936").encode("utf-8")) postData = {} postData['str'] = str ...post请求发送代码...
php端:
[u]复制代码[/u] 代码如下:
$str = urldecode($_POST['str']) echo $str;
完美解决乱码问题!
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部