Re: Bug #6173: urlencode() doesn't respect locale
| From: | Joey Smith | Date: | Tue, 15 Aug 2000 16:33:54 +0000 |
| Subject: | Re: Bug #6173: urlencode() doesn't respect locale | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-28996@lists.php.net to get a copy of this message | ||
Hmm...
I'm not sure that this is a bug.
RFC 1738 says:
URLs are written only with the graphic printable
characters of the US-ASCII coded character set.
I realize that urlencode() is not RFC 1738 directly,
but still...
On 15 Aug 2000, mbravo@acm.org wrote the following to php-dev@lists.php.net :
> From: mbravo@acm.org
> Operating system: FreeBSD 4.1
> PHP version: 3.0.16
> PHP Bug Type: Misbehaving function
> Bug description: urlencode() doesn't respect locale
>
> By definition, urlencode() should leave alphanumeric characters unencoded.
> However, (uin my case) it doesn't respect locale settings, and encodes
> non-ASCII (but alphanumeric as per locale definition) characters when it
> shouldn't. Locale is correctly set up, and Apache does have correct LANG
> and LC_ALL environment variables in its runtime environment (checked by
> phpinfo()). I even tried executing explicit setlocale() call within a
> script but this doesn't change anything (which is probably correct as
> locale is already set systemwide)
>
> I don't know if this problem is peculiar to FreeBSD installations,
> perhaps someone should check this out - might be possible, since
> judging by source code, system isalphanum() is used to determine
> whether a character should be encoded. However, FreeBSD in general handles
> locale very responsibly and this wouldn't be possible if fundamental checks
> like isalpha() were broken.
>