|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-01-10 14:54 UTC] bugsphpnet at atis dot id dot lv
Description: ------------ --- From manual page: http://www.php.net/function.xmlrpc-encode --- UTF-8 characters are incorrectly encoded. 208 character code turns into 28, and 209 turns into 29, etc PHP 5.3.10 did not had this problem. Problem has been reproduced on versions: PHP 7.1.0-5+deb.sury.org~xenial+1 (cli) ( NTS ) PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS ) Test script: --------------- <?php print_r(xmlrpc_encode('Москва')); Expected result: ---------------- <?xml version="1.0" encoding="utf-8"?><params><param><value><string>Москва</string></value></param></params> Actual result: -------------- <?xml version="1.0" encoding="utf-8"?><params><param><value> <string>œ¾º²°</string></value></param></params> PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 17:00:01 2025 UTC |
For anyone stumbling upon this, a quick and ugly workaround: /* Original call */ $response = xmlrpc_server_call_method($srv, $request, NULL, array('encoding'=>'UTF-8', 'verbosity'=>'no_white_space')); $response = str_replace(array('',''),array('Ð','Ñ'),$response);> Which PHP version do you use? PHP Version 7.1.1-1+deb.sury.org~xenial+1 Test on utf8-html docs _________________________________________ before Update #apcu_delete('try'); $arrayx = array( "name" => utf8_decode("täst"), "position" => utf8_decode("Gärtner") ); apcu_store('try', $arrayx, 3600); print_r(apcu_fetch('try')); the output was Array ( [name] => täst [position] => Gärtner ) after update the output was Array ( [name] => t�st [position] => G�rtner ) now i have to change all scripts #apcu_delete('try'); $arrayx = array( "name" => "täst", "position" => "Gärtner" ); apcu_store('try', $arrayx, 3600); print_r(apcu_fetch('try')); the output is Array ( [name] => täst [position] => Gärtner ) the problem, all sessions with umlauts are no longer output correctly, which also results in a === test error.