note 95636 deleted from function.urldecode by danbrown

From: Date: Wed, 13 Jan 2010 15:50:10 +0000
Subject: note 95636 deleted from function.urldecode by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-164914@lists.php.net to get a copy of this message
Note Submitter: Johan de Mander ---- 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>

« previous php.notes (#164914) next »