#19569 [Opn->Bgs]: urlencode() problem encoding strings containing single quotes
| From: | hholzgra@php.net | Date: | Tue, 24 Sep 2002 08:02:51 +0000 |
| Subject: | #19569 [Opn->Bgs]: urlencode() problem encoding strings containing single quotes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-20170@lists.php.net to get a copy of this message | ||
ID: 19569
Updated by: hholzgra@php.net
Reported By: dbarndt@ntlpromos.com
-Status: Open
+Status: Bogus
Bug Type: *URL Functions
Operating System: Windows NT 4.0 SP6
PHP Version: 4.2.3
New Comment:
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem does not imply a bug in PHP itself.
For a list of more appropriate places to ask for help using PHP,
please visit http://www.php.net/support.php
Thank you for your interest in PHP.
do not use printf unless you know what you are doing,
use plain print or echo instead
*and* please have a look at your error log first
before reporting problems
you would have seen a message like
Warning: printf(): too few arguments in ... on line 9
due to the fact that urlencode() converts your string to
"Mickey%27s+Fun+House", so requesting to output the 2nd parameter (not
given here) as a 27 character wide string
see http://php.net/print and http://php.net/print for
the different semantics of print() and printf()
Previous Comments:
------------------------------------------------------------------------
[2002-09-24 02:03:33] dbarndt@ntlpromos.com
fixed typo in title
------------------------------------------------------------------------
[2002-09-24 02:01:29] dbarndt@ntlpromos.com
I really hesitated putting this in as a bug, because it seems so
simple. The urlencode() documentation seems to imply that the
following script should work fine, however it fails to output the
second printf() on my system. I am running with the
php.ini-recommended INI file on Windows NT 4.0 SP6. (I've tried
various combinations of htmlentities() and htmlspecialchars() with the
urlencode() as well, but so far without success.)
Here's the script:
<html>
<head>
</head>
<body>
<?php
$test_str = "Mickey's Fun House";
printf ($test_str);
$encoded_str = urlencode ($test_str);
printf ($encoded_str);
?>
</body>
</html>
If this is something stupid on my end, I apologize for the bother.
Thanks,
Dave Barndt
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19569&edit=1