note 18197 deleted from function.urldecode by nlopess
| From: | nlopess@php.net | Date: | Tue, 13 Jan 2004 14:45:03 +0000 |
| Subject: | note 18197 deleted from function.urldecode by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-63421@lists.php.net to get a copy of this message | ||
Note Submitter: nataniel@NOSPAM.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, 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
You have to "manually" convert it to html entitles:
------------------------------------------------------------
function unicode_decode($txt) {
return ereg_replace('%u0([[:alnum:]]{3})', '&#x\1;',$txt);
}
------------------------------------------------------------