#41239 [Opn->Bgs]: Special chars not handled as alpha numeric

From: Date: Mon, 30 Apr 2007 10:46:50 +0000
Subject: #41239 [Opn->Bgs]: Special chars not handled as alpha numeric
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-112078@lists.php.net to get a copy of this message
ID: 41239 Updated by: derick@php.net Reported By: rene dot stabingis at gmail dot com -Status: Open +Status: Bogus Bug Type: *Regular Expressions Operating System: Linux 2.6.13.2 (Debian 3.1) PHP Version: 5.2.1 New Comment: You need to use the correct locale, see setlocale() documentation. Previous Comments: ------------------------------------------------------------------------ [2007-04-30 10:21:25] rene dot stabingis at gmail dot com Description: ------------ This code should delete all non-alphanumeric signs (except spaces). If you have latin special chars like "ü", on the linux machine they are deleted. On a win environment using same php version they are kept as alnum. The deb machine runs with ISO-8859-1 charset. Reproduce code: --------------- $somePhrase = 'i don\'t know why, but many people know über'; echo preg_replace('/[^[:alnum:][:space:]]/', '', $somePhrase); Expected result: ---------------- i dont know why but many people know über Actual result: -------------- i dont know why but many people know ber ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41239&edit=1

« previous php.bugs (#112078) next »