Using the British pound sign in an XML feed to be read by an iPhone

前端 未结 4 798
梦如初夏
梦如初夏 2021-01-05 15:33

I have created a web-based UTF-8 XML feed for use in an iPhone application.

When viewing in a web browser, if the feed contains a British Pound sign, I get a nasty X

4条回答
  •  时光说笑
    2021-01-05 15:45

    As you've shown a PHP code snippet...

    I had the same problem, but your sample xmlEntities($text) { ... } function above didn't work.

    Changing to just htmlspecialchars() did work however - as (in my case) I only care about characters which would screw up the parsing of the XML document (<,> etc), everything else should be valid unicode ....

提交回复
热议问题