The behavior of xml_parser($encoding) changed in PHP5 :

Starting from PHP 5, the input encoding is automatically detected, so that the encoding parameter specifies only the output encoding [and not anymore the output encoding].

This change brakes the conversion of encoding of XML documents done by Drupal in function drupal_xml_parser_create() : we now need to change the encoding= parameter in the <?xml ?> tag after the conversion to utf-8.

Among others, this affects the aggregator module.

The included patch is a one-line addition in include/common.inc (in 4.6.5 and lower), or in include/unicode.inc (since 4.7.0).

- DamZ

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Zen’s picture

Priority: Critical » Normal

Downgrading. Please confirm if this is necessary for 4.7 for a better chance of getting this in.

Thanks
-K

Damien Tournoud’s picture

Priority: Normal » Critical

This is needed in all code bases since the first implementation of drupal_xml_parser_create(), thus including drupal 4.6.5 AND the current HEAD.

Upgrading the priority again.

- DamZ

Zen’s picture

Version: 4.6.5 » x.y.z

Please also provide a patch against HEAD and a link to related documentation.

Thanks
-K

Morbus Iff’s picture

This will not be fixed for 4.6.x. If it were, it gives license (and "but we haveee tOOO!") to backport phptemplate in core (since xtemplate doesn't work in php 5.1.x). Thus, it's a HEAD only issue.

Morbus Iff’s picture

It appears this patch attempts to do the right thing, but it sets "utf8" instead of "utf-8".

Dries’s picture

Status: Needs review » Needs work

Doesn't apply against CVS HEAD.

Morbus Iff’s picture

Status: Needs work » Needs review
FileSize
1.88 KB

Updated patch with new docs, less code, and a small bugfix.

Dries’s picture

Status: Needs review » Fixed

Committed to HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)