Timon Posted May 2, 2006 Share Posted May 2, 2006 I'm building a site which displays some rss feeds to visitors. Because our target audience contains people from different coutries, we try to keep it a bit international by providing feeds in Dutch, German and English. The Dutch and English feeds go well so far, but when a german feed contains german characters, they won't be displayed correctly (for example, ß becomes ß ). The code I use can be found here:[a href=\"http://pastebin.com/694184\" target=\"_blank\"]http://pastebin.com/694184[/a](i've tried pasting the code in and putting code tags around it, but then it wouldn't let me post my message)I've already tried without the htmlentities/striptags/html_entity_decode lines (line 103/104), this does not work. Could it be because the results are being cached in a file, that during file I/O characters get converted? Quote Link to comment Share on other sites More sharing options...
Timon Posted May 3, 2006 Author Share Posted May 3, 2006 I've figured it out for myself already, I'll post the solution here so that anyone else having the same problem may learn from it:The problem was that the rss feed was encoded in the UTF-8 character set (newsfeeds usually are). The character set which I use for the site is ISO-8859-1. To convert a string from UTF-8 to ISO-8859-1, the iconv statement can be used. In my case, all I had to do was insert:[code]$feed_input = iconv("UTF-8", "ISO-8859-1", $feed_input);[/code]after reading the feed contents and before replacing any special characters with html entities. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.