note 95636 added to function.urldecode
| From: | JohandeMander at osu1 dot php dot net | Date: | Wed, 13 Jan 2010 15:27:20 +0000 |
| Subject: | note 95636 added to function.urldecode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-164912@lists.php.net to get a copy of this message | ||
Decoding a string generated by the JavaScript function encodeURI() with urldecode() may generate
uncorrect output if a character that is not part of the standard ASCII table is passed through
encodeURI(). Be sure to use the JavaScript function escape() instead. And vice versa ofcourse.
http://www.asciitable.com/
Note:
The character Ã
is a part of the Extended ASCII table.
<?php
echo urlencode("Ã
"); //Output: %C5
echo urldecode("%C5"); //Output: Ã
echo urldecode("%C3%85"); //Output: Ãâ¦
?>
<script language="javascript">
document.write(encodeURI("Ã
")); //Ouput: %C3%85
document.write(escape("Ã
")); //Output: %C5
</script>
----
Server IP: 62.237.7.3
Probable Submitter: 194.112.8.126
----
Manual Page -- http://www.php.net/manual/en/function.urldecode.php
Edit -- https://master.php.net/note/edit/95636
Del: integrated -- https://master.php.net/note/delete/95636/integrated
Del: useless -- https://master.php.net/note/delete/95636/useless
Del: bad code -- https://master.php.net/note/delete/95636/bad+code
Del: spam -- https://master.php.net/note/delete/95636/spam
Del: non-english -- https://master.php.net/note/delete/95636/non-english
Del: in docs -- https://master.php.net/note/delete/95636/in+docs
Del: other reasons-- https://master.php.net/note/delete/95636
Reject -- https://master.php.net/note/reject/95636
Search -- https://master.php.net/manage/user-notes.php