Zend_Soap客户端和SoapServer UTF-8编码问题
该站点在一台服务器上运行,数据库在另一台服务器上运行。当我在网站上输入文本以用非英文字母提交到数据库时,它会保存并呈现正确的内容。例如,如果我输入“Привет Всем”,我将在显示时在网站上看到相同的文本。
所有 MySQL 排序规则作为表和字段都是 utf8_general_ci 页面上的元内容编码也是 utf-8 ,就像在 phpMyAdmin 上一样,
尽管如果我使用 phpMyAdmin 访问数据库,我会看到 КÐ⁄нÑтнатин ПаР如果我将其更改为 Привет Всем 然后在网站上我会看到 ????????? ????
在我们在两台装有 Windows 的不同服务器上进行的本地测试中,它并没有像这样工作。但是部署到centOS在线服务器后,它就变成这样了。
看起来它会将文本双重编码为 UTF-8。我找不到它在哪里。
Zend_Soap_Client:: 或 SoapServer:: 或 MySQL 编码。
我拒绝了Mysql的想法,因为我认为如果它是MySQl那么它会保存错误,然后当它提取时它应该发送错误的数据。
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_Client:: 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许您应该尝试将 Zend_Soap_Client 或 SoapServer 配置为使用 utf8?
对于 Zend_Soap_Client 可以这样做:
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: