FeedsSimplePieParser.inc contains the following code:

$item['title'] = html_entity_decode(($title = $simplepie_item->get_title()) ? $title : $this->createTitle($simplepie_item->get_content()));

html_entity_decode() returns ISO-8859-1 encoded characters, which is incompatible with the encoding of the database connection, resulting in the following error:

SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xE9mand ...'

I fixed it by changing the above line of code (around line 94) to:

$item['title'] = html_entity_decode(($title = $simplepie_item->get_title()) ? $title : $this->createTitle($simplepie_item->get_content()), NULL, 'UTF-8');

Now the characters are encoded in UTF-8 and the feed items are saved properly.

Because this is a one-line change, I don't make a patch file. If the maintainers would like a patch file, I am more than happy to provide it. The file FeedsSimplePieParser.inc contains more instances of the html_entity_decode() function, those need to be changed as well I assume.

Comments

Jaafarx’s picture

Hi,

I tried the code above, it didn't work. I also have <div></div> added around some titles.

Jaafarx’s picture

Solved with feeds tamper.