note 95636 added to function.urldecode

From: 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

« previous php.notes (#164912) next »