#30382 [Opn]: preg_match and utf-8
| From: | aidan@php.net | Date: | Sun, 10 Oct 2004 14:00:20 +0000 |
| Subject: | #30382 [Opn]: preg_match and utf-8 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-67359@lists.php.net to get a copy of this message | ||
ID: 30382
Updated by: aidan@php.net
Reported By: TiloLutz at gmx dot de
Status: Open
-Bug Type: PECL related
+Bug Type: Regexps related
Operating System: Suse Linux 9.1
PHP Version: 4.3.9
New Comment:
Reassigning to proper category.
Previous Comments:
------------------------------------------------------------------------
[2004-10-10 15:49:47] TiloLutz at gmx dot de
Description:
------------
preg_match doesn't work correct when utf-8 is used
preg_match('/^([[:alpha:]])*$/u', "ä")
should return true because [[:alpha:]] contains
also localized special characters like äöü.
Unfortunatly it returns false.
It works with iso-8859-15 but doesn't work with utf-8
Reproduce code:
---------------
putenv("LANG=de_DE");
setlocale(LC_ALL, "de_DE");
if (preg_match('/^([[:alpha:]])*$/u', "ä") echo "true";
putenv("LANG=de_DE.utf8");
setlocale(LC_ALL, "de_DE.utf8");
if (preg_match('/^([[:alpha:]])*$/u', "ä") echo "true";
Expected result:
----------------
true
true
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30382&edit=1