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

Issue Type: Bug Created: 2009-11-04T01:47:48.000+0000 Last Updated: 2009-11-22T01:27:08.000+0000 Status: Resolved Fix version(s): - 1.9.6 (24/Nov/09)

Reporter: Karol Grecki (antych) Assignee: Pádraic Brady (padraic) Tags: - Zend_Feed_Reader

Related issues: Attachments:


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.

<pre class="highlight">
if (! $feed->getDomDocument()->encoding) {
    $feed->getDomDocument()->encoding = 'UTF-8';


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.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.