From:             [EMAIL PROTECTED]
Operating system: All
PHP version:      4.1.1
PHP Bug Type:     *Languages/Translation
Bug description:  Unicode chars (query string decoding)

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 bug report at: http://bugs.php.net/?id=15027&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to