开发者

Zend_Soap client and SoapServer UTF-8 encoding problem

开发者 https://www.devze.com 2023-02-13 23:09 出处:网络
The site works on one server and DB on the other server. When I enter on site text to submit to DB on non english letters, it saves and ther render corect. For example if I enter \"Привет Все

The site works on one server and DB on the other server. When I enter on site text to submit to DB on non english letters, it saves and ther render corect. For example if I enter "Привет Всем" I will see the same text on the site when display.

All MySQL collation as table as fields are utf8_general_ci Meta content-encoding on the page also utf-8 as on site as on phpMyAdmin

Although if I access DB with phpMyAdmin I see КонÑтнатин ПаРIf I change it to Привет Всем then on the site I see ???????? ????

It was not working like this on our local test on 2 different servers with Windows on them. But after deploy to centOS online server it bacome work like this.

Looks like it double encode text to UTF-8. I cannot find where is it.

Zend_Soap_C开发者_如何学JAVAlient:: or SoapServer:: or MySQL encoding.

I rejected idea of Mysql because I though that if it is MySQl then it saves wrong, and then when it extraxts it should send wrong data.


Perhaps you should try to configure Zend_Soap_Client or SoapServer to use utf8? In case of Zend_Soap_Client it can be done like this:

$client = new Zend_Soap_Client("http://my.site/my.wsdl", array('encoding' => 'UTF-8'));
0

精彩评论

暂无评论...
验证码 换一张
取 消