Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.15

Bug #14274 PEAR packager mangles package.xml encoding, then complains about it
Submitted: 2008-07-01 21:53 UTC
From: ieure Assigned: dufuz
Status: Closed Package: PEAR (version 1.7.2)
PHP Version: 5.2.5 OS: Mac OS X
Roadmaps: 1.8.0alpha1    
Subscription  


 [2008-07-01 21:53 UTC] ieure (Ian Eure)
Description: ------------ `pear package' mangles the encoding of my package.xml file. I use the Unicode U+00A9 (Copyright, ©) symbol. In my package.xml, this is represented by the 0xC2 0xA9 UTF-8 byte sequence. However, in the package.xml file in the .tgz pear creates, this has been replaced with octal 251 (0xA9), which is the ISO-8859-1 encoding for the character. The package.xml file is correctly declared as having UTF-8 encoding, and this is not changed in the package.xml in the .tgz file. If I then try to install the package which PEAR generated, I get this error: XML Error: 'Invalid character' on line '23' Cannot initialize 'Test-1.0.0beta2.tgz', invalid or missing package file Package "Test-1.0.0beta2.tgz" is not valid install failed Line 23 contains the (now) invalid character. Test script: --------------- Try to package something with a © symbol and UTF-8 encoding. Expected result: ---------------- Encoding is left alone. Actual result: -------------- Characters are transliterated to ISO-8859-1, and the declared encoding is untouched, resulting in an unparseable document.

Comments

 [2008-07-10 23:31 UTC] dufuz (Helgi Þormar Þorbjörnsson)
Would it be possible for you to try this with PHP 4 ? I'm looking at some weird code in the installer and it seems to handle PHP 4 and 5 differently and thus I'm scratching my head and wondering.
 [2008-07-12 14:24 UTC] dufuz (Helgi Þormar Þorbjörnsson)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.
 [2008-07-12 14:25 UTC] dufuz (Helgi Þormar Þorbjörnsson)
Now we have better detection and also we do write out the xml file in the encoding we decide to convert to if that ever happens.