开发者

simplexml_load_string() doesn't like foreign languages

I am receiving an XML response which comes through perfectly.

Words such as "português" and "españa" are correctly formatted.

However, once I have parsed the XML through the php function simplexml_load_string(), the words are transformed as follows: "por开发者_JAVA技巧tugu�s" and "espa�a".


Simple XML always treats text internally as UTF-8 encoded, converting to and from this character set if necessary. To solve your issue either make sure that all output from your app is UTF-8 encoded or convert it to another character set (possibly using utf8decode()).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜