Reputation: 42013
I'm using a simple php script to scour an RSS feed, store the scoured data to a temporary cache flat file, then display it along the side of my website. However all the characters with accents appear as "�" What is causing this and how can I fix it?
Upvotes: 0
Views: 486
Reputation: 2162
You're having a problem with your character encoding. Depending on which encoding the feed uses, you have to use the same to display your data, or try to convert it to the encoding you're using on your website. PHP offers iconv() for that purpose, for example.
In case the encoding is UTF-8 (or any other multibyte encoding), you also have to make sure you use multibyte-safe functions/methods in your PHP scripts, in case you process the feed in your application.
To deliver your content in UTF-8, for example, you have to send the appropriate content header before any other output.
Example:
header('Content-Type: text/html; charset=utf-8');
Upvotes: 3