Re: Re: cvs: php-src /ext/libxml/tests 002.phpt /ext/reflection/tests005.phpt
| From: | Rob Richards | Date: | Wed, 20 Sep 2006 11:42:08 +0000 |
| Subject: | Re: Re: cvs: php-src /ext/libxml/tests 002.phpt /ext/reflection/tests005.phpt | ||
| References: | 1 2 3 4 5 | Groups: | php.cvs php.internals |
| Request: | Send a blank email to internals+get-25773@lists.php.net to get a copy of this message | ||
Michael Wallner wrote:
Derick Rethans wrote:Sorry I took so long to answer this, but was playing around with some of the conversions to make sure I gave an accurate answer here. The reason I had required them to be binary strings was to provide consistent encoding handling when working with in memory XML. Before even looking at the XML issues, consider the following line: $xml = '<?xml version="1.0" encoding="ISO-8859-1"?><test>ü</test>'; I get PHP parse errors when my script_encoding is set to UTF-8. When set to iso-8859-1 it works fine. Making this a binary string works fine in both modes and now uses the encoding defined by the XML document itself (BOM or encoding defined in xml declaration - the way it really should be) making it portable to be passed to the XML load functions. RobOn Tue, 19 Sep 2006, Antony Dovgal wrote:I remember Rob mentioning something about utf8 in "unicode and xml extensions" @internals.Then I suggest to revert the change to the test and that we look at fixing the issue instead :)But it doesn't, because SimpleXml REQUIRES binary string. I don't understand why and I don't like it either, but that's what we have.http://cvs.php.net/viewvc.cgi/php-src/ext/libxml/tests/002.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/libxml/tests/002.phpt diff -u php-src/ext/libxml/tests/002.phpt:1.2 php-src/ext/libxml/tests/002.phpt:1.3 --- php-src/ext/libxml/tests/002.phpt:1.2 Tue Jun 27 22:54:29 2006 +++ php-src/ext/libxml/tests/002.phpt Tue Sep 19 12:06:49 2006 @@ -16,7 +16,7 @@You shouldn't have to do this actually... as the original code should just still work fine.</movies>XML; -$doc = simplexml_load_string($xmlstr); +$doc = simplexml_load_string((binary)$xmlstr); $xml = explode("\n", $xmlstr);