Issues

ZF-8213: Zend Feed assumes invalid encoding if not specified

Description

getEncoding() returns null when it's not specified in an XML document. This gets passed to html_entity_decode() which assumes latin1 where it should be UTF-8. This results in warnings and broken Unicode characters.

html_entity_decode(): charset `ANSI_X3.4-1968' not supported, assuming iso-8859-1 in Zend/Feed/Reader/Entry/Rss.php:328"

I managed to work around it with code below, but I think getEncoding() should never return null, but UTF-8 instead.


if (! $feed->getDomDocument()->encoding) {
    $feed->getDomDocument()->encoding = 'UTF-8';
}

Comments

Fixed in r19040 to return a default value.

I set fix version.