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

Bug #11280 Xmlrpcext escapes UTF-8
Submitted: 2007-06-11 12:44 UTC
From: carewolf Assigned: sergiosgc
Status: Closed Package: XML_RPC2 (version 1.0.1)
PHP Version: 5.2.6 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2007-06-11 12:44 UTC] carewolf (Allan Sandfeld)
Description: ------------ When sending data that contains utf-8 strings, the characters are XML-escaped for instance 'å' becomes &#192:¹. This means they are incorrectly parsed in the other end. The problem is the default 'escaping':'non-ascii' option in xmlrpc_encode_request which fails to convert to UTF-16 before XML escaping. A temporary solution is to use a 'escaping':'markup' option instead. The correct solution is to fix xmlrpc_encode_request.

Comments

 [2007-12-05 16:50 UTC] sergiosgc (Sérgio Carvalho)
I've tried reproducing the bug, and it shows me no escaped content. Can you provide a test case? Grab one from the package source and modify until it produces this error. Example test case: http://cvs.php.net/viewvc.cgi/pear/XML_RPC2/tests/XML_RPC2/phpBackend/regressions/11135.phpt?revision=1.1&view=markup
 [2007-12-06 08:57 UTC] carewolf (Allan Sandfeld)
--TEST-- Regression guard against bug 11280: Xmlrpcext escapes UTF-8 --FILE-- <?php $output = xmlrpc_encode_request('test', array('hello' => 'wørld'), array('encoding' => 'utf-8')); print '<pre>'; print $output; print '</pre>'; ?> --EXPECT--
 [2007-12-06 08:58 UTC] carewolf (Allan Sandfeld)
Btw, I am a blind when I can't find a place to attach test-cases to bugs?
 [2007-12-06 22:44 UTC] sergiosgc (Sérgio Carvalho)
Thx for the test case. Indeed, pear bug should ask for the test case itself. There's no option for attaching a test case here.
 [2008-02-18 15:29 UTC] mellen (Tais Hansen)
Seems like another one got bitten by this behavior: http://dk2.php.net/manual/en/function.xmlrpc-encode-request.php#80907 Is there any progress on solving this issue? (it's still present in 1.0.2)
 [2008-02-19 09:40 UTC] mellen (Tais Hansen)
I've added a patch which exposes the escaping option in xmlrpc_encode_request. If left unspecified it will just follow default behavior, so it shouldn't break anything.
 [2008-09-09 13:51 UTC] gauthierm (Michael Gauthier)
This bug only occurs if you use the PECL xmlrpc backend. The Php backend is currently unaffected. I can also confirm it occurs with the latest PHP (5.2.6).
 [2008-09-10 19:08 UTC] sergiosgc (Sérgio Carvalho)
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.