Bug #15027 Updated: Unicode chars (query string decoding)
| From: | jimw@php.net | Date: | Tue, 09 Apr 2002 22:38:21 +0000 |
| Subject: | Bug #15027 Updated: Unicode chars (query string decoding) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-4487@lists.php.net to get a copy of this message | ||
ID: 15027
Updated by: jimw@php.net
Reported By: nataniel@implix.com
-Status: Open
+Status: Bogus
Bug Type: *Languages/Translation
Operating System: All
PHP Version: 4.1.1
New Comment:
%u encoding is not standard.
Previous Comments:
------------------------------------------------------------------------
[2002-01-14 05:57:26] nataniel@implix.com
urldecode() function is not supporting UNICODE characters coding, like
%u0627 for the Arabic letter ALEF (ا in HTML). So when you are
passing the Unicode chars through GET/POST or urldecode(), you will get
only encoded string:
http://server.com/test.php?test=%u062D%u0645%u0627%u062F%u0629
in test.php:
print('test = '.$test);
you will get:
test = %u062D%u0645%u0627%u062F%u0629
What you have to do is to "manually" convert it to html entitles:
------------------------------------------------------------
function unicode_decode($txt) {
return ereg_replace('%u0([[:alnum:]]{3})', '&#x\1;',$txt);
}
------------------------------------------------------------
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15027&edit=1