Zend Framework

Zend Feed assumes invalid encoding if not specified

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.5
  • Fix Version/s: 1.9.6
  • Component/s: Zend_Feed_Reader
  • Labels:
    None

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';
}

Activity

Hide
Pádraic Brady added a comment -

Fixed in r19040 to return a default value.

Show
Pádraic Brady added a comment - Fixed in r19040 to return a default value.
Hide
Satoru Yoshida added a comment -

I set fix version.

Show
Satoru Yoshida added a comment - I set fix version.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: