note 18197 added to function.urldecode
| From: | nataniel at NOSPAM dot implix dot com | Date: | Mon, 14 Jan 2002 10:50:08 +0000 |
| Subject: | note 18197 added to function.urldecode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-24793@lists.php.net to get a copy of this message | ||
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);
}
------------------------------------------------------------
--
http://www.php.net/manual/en/function.urldecode.php
http://master.php.net/manage/user-notes.php?action=edit+18197
http://master.php.net/manage/user-notes.php?action=delete+18197
http://master.php.net/manage/user-notes.php?action=reject+18197