Bug #45602 [Opn->Wfx]: urlencode/urldecode should use ASCII encoding
| From: | felipe@php.net | Date: | Mon, 21 Jun 2010 00:13:09 +0000 |
| Subject: | Bug #45602 [Opn->Wfx]: urlencode/urldecode should use ASCII encoding | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-151699@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=45602&edit=1
ID: 45602
Updated by: felipe@php.net
Reported by: samuel at slbdata dot se
Summary: urlencode/urldecode should use ASCII encoding
-Status: Open
+Status: Wont fix
Type: Bug
Package: URL related
Operating System: Ubuntu 8.04.1
PHP Version: 6CVS-2008-07-23 (snap)
New Comment:
Old trunk related.
Previous Comments:
------------------------------------------------------------------------
[2008-07-31 23:12:25] jani@php.net
See also bug #45566 (you missed the hash there :)
------------------------------------------------------------------------
[2008-07-23 11:44:14] samuel at slbdata dot se
Description:
------------
The "URL Generic Syntax" specification (RFC 2396) says that URLs must be
US-ASCII. However, the PHP urlencode/decode functions return/accept
binary data only. I think the correct behaviour would be to use Unicode
(which is a superset of ASCII) for the encoded values.
(This might affect some other URL-related functions, but
urlencode/urldecode are the only ones that I know)
See also bug 45566 . Since it's quite likely for urldecode's input to
come from the $_SERVER superglobal, I think either both or none of the
bugs should be fixed.
Reproduce code:
---------------
<?php
echo urldecode("%50%48%50\n");
Expected result:
----------------
PHP
Actual result:
--------------
PHP Warning: urldecode() expects parameter 1 to be strictly a binary
string, Unicode string given in - on line 3
Warning: urldecode() expects parameter 1 to be strictly a binary string,
Unicode string given in - on line 3
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=45602&edit=1