Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using an RSS feed importer. When i preview the feed, the special characters such as è,à and so on are throwing out gibberish.

Searching on the WP.org forum I came across the suggestion to add the code below to the wp-config file.

Adding the code hasn't made any difference at all. My DB is in utf-8 format.

define('DB_CHARSET', 'utf8');           // force utf8
define('DB_COLLATE', 'utf8_general_ci');    // force collation

Any suggestions on this please? As I cannot add new tags (encoding/utf) putting this to the nearest available tag.

Defining 'gibberish'

è is displayed as � ì is displayed as �¬ and so on

share|improve this question
    
Define gibberish. Do you get two characters instead of one or one broken character? –  toscho Jun 7 '11 at 9:07
    
I've updated the characters.. hope that this will help. –  Sledge81 Jun 7 '11 at 10:54
    
Does the RSS feed importer save feeds to your database? Or just output them on-the-fly on your website? You say when you preview the feed you get gibberish - are you talking about the feed you are scraping (i.e. the source), or the feed on your website? –  TheDeadMedic Jun 7 '11 at 13:07
    
It does save to the database. But at the first instance of any of the words with an accent the rest of the post is terminated. I am referring to previewing the feed before I do a full export. –  Sledge81 Jun 7 '11 at 13:10

1 Answer 1

The content you get is not utf-8 encoded or the encoding is damaged by the importer. Usually SimplePie – the feed reader WordPress uses – is quite good at handling such cases. I wonder what an importer you use …

Anyway, I’ve written a function to enforce utf-8 output. You should implement this very early in the import process. The article is in German – let me know if I should add more explanations here.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.