dsizmmwnm56437180 2009-04-03 16:33
浏览 90

克服PHP,SoapServer,UTF-8和非英文字符的编码问题?

I'm having problems getting PHP to play nicely with SoapServer + UTF-8. Anytime anyone sends a Soap Request with non english characters (i.e. funny quotes, accented characters, etc) the SoapServer throws an exception saying "Bad Request." I've tried decoding the request with utf8_decode and even HTML Special Characters encoded the text. Nothing is working for me.

I'm looking for a point in the right direction because I'm lost at the moment.

  • 写回答

2条回答 默认 最新

  • dongxi2014 2009-04-03 16:43
    关注

    make sure both SoapServer and SoapClient are initialized with UTF-8 encoding:

    $client = new SoapClient("some.wsdl", array('encoding'=>'UTF-8'));
    $server = new SoapServer("some.wsdl", array('encoding'=>'UTF-8'));
    

    does the XML of the requests with the "funny quotes, accented characters, etc." validate?

    评论

报告相同问题?

悬赏问题

  • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
  • ¥30 线性代数的问题,我真的忘了线代的知识了
  • ¥15 有谁能够把华为matebook e 高通骁龙850刷成安卓系统,或者安装安卓系统
  • ¥188 需要修改一个工具,懂得汇编的人来。
  • ¥15 livecharts wpf piechart 属性
  • ¥20 数学建模,尽量用matlab回答,论文格式
  • ¥15 昨天挂载了一下u盘,然后拔了
  • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题
  • ¥20 易康econgnition精度验证
  • ¥15 msix packaging tool打包问题