Bug #73908 [Fbk->Nab]: Invalid UTF-8 encoding

From: Date: Tue, 17 Jan 2017 15:34:12 +0000
Subject: Bug #73908 [Fbk->Nab]: Invalid UTF-8 encoding
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206712@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73908&edit=1 ID: 73908 Updated by: cmb@php.net Reported by: bugsphpnet at atis dot id dot lv Summary: Invalid UTF-8 encoding -Status: Feedback +Status: Not a bug Type: Bug Package: XMLRPC-EPI related Operating System: Ubuntu 16.04 PHP Version: 7.1.0 Assigned To: cmb Block user comment: N Private report: N New Comment: Thanks! Previous Comments: ------------------------------------------------------------------------ [2017-01-17 15:21:05] bugsphpnet at atis dot id dot lv Could not reproduce on vanilla php7, submitted downstream: https://bugs.launchpad.net/ubuntu/+source/php7.0/+bug/1657158 ------------------------------------------------------------------------ [2017-01-15 13:37:12] cmb@php.net I'm not able to reproduce this with builds of the php.net distribution, so this *might* be a downstream issue. Please check whether it also works for you with such a build. ------------------------------------------------------------------------ [2017-01-10 14:56:34] bugsphpnet at atis dot id dot lv 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('&#28;','&#29;'),array('&#208;','&#209;'),$response); ------------------------------------------------------------------------ [2017-01-10 14:54:05] 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>&#208;&#156;&#208;&#190;&#209;&#129;&#208;&#186;&#208;&#178;&#208;&#176;</string></value></param></params> Actual result: -------------- <?xml version="1.0" encoding="utf-8"?><params><param><value> <string>&#28;&#156;&#28;&#190;&#29;&#129;&#28;&#186;&#28;&#178;&#28;&#176;</string></value></param></params> ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73908&edit=1

« previous php.bugs (#206712) next »