#30382 [NEW]: preg_match and utf-8
From: TiloLutz at gmx dot de
Operating system: Suse Linux 9.1
PHP version: 4.3.9
PHP Bug Type: PECL related
Bug description: preg_match and utf-8
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 bug report at http://bugs.php.net/?id=30382&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30382&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30382&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30382&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30382&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30382&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30382&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30382&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30382&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30382&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30382&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30382&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30382&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30382&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30382&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30382&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30382&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30382&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30382&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30382&r=mysqlcfg
Thread (1 message)
- TiloLutz at gmx dot de