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
Posted by Pádraic Brady (padraic) on 2009-11-19T07:18:21.000+0000
Fixed in r19040 to return a default value.
Posted by Satoru Yoshida (satoruyoshida) on 2009-11-22T01:27:05.000+0000
I set fix version.