Re: PHP 4.0 Bug #5426: Regexp functions are case sensitive when working with high ASCII characters
| From: | Stefan Livieratos | Date: | Thu, 06 Jul 2000 09:20:19 +0000 |
| Subject: | Re: PHP 4.0 Bug #5426: Regexp functions are case sensitive when working with high ASCII characters | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-23683@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: <marten@jerbro.se>
To: <php-dev@lists.php.net>
Sent: Friday, July 07, 2000 11:00 AM
Subject: [PHP-DEV] PHP 4.0 Bug #5426: Regexp functions are case sensitive
when working with high ASCII characters
> From: marten@jerbro.se
> Operating system: Linux - Debian Slink
> PHP version: 4.0 Latest CVS (06/07/2000)
> PHP Bug Type: Misbehaving function
> Bug description: Regexp functions are case sensitive when working with
high ASCII characters
>
> Snippet:
> <?
> if(eregi('å|ä|ö', 'Å')) echo 'MATCH'.chr(10);
> if(preg_match('/å|ä|ö/i', 'Å')) echo 'MATCH'.chr(10);
> echo eregi_replace('å|ä|ö', 'x', 'ÅÄÖ');
> echo preg_replace('/å|ä|ö/i', 'y', 'ÅÄÖ');
> ?>
>
> The output from the snippet should be:
> MATCH
> MATCH
> xxxyyy
>
> But the output is:
> ÅÄÖÅÄÖ
You have to set your locale correctly (see also Bug #5241).
Before you start Apache type:
> export LANG=swedish
Then start Apache
> apachectl start
Now it should work.
Regards,
Stefan
P.S.: Please close your bug report.