Bug #27668 [Com]: ctype_alpha fails to identify some characters

From: Date: Thu, 22 Sep 2011 14:14:14 +0000
Subject: Bug #27668 [Com]: ctype_alpha fails to identify some characters
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-163789@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=27668&edit=1 ID: 27668 Comment by: garioch2 at googlemail dot com Reported by: amd at tt dot ee Summary: ctype_alpha fails to identify some characters Status: Bogus Type: Bug Package: *Languages/Translation Operating System: Gentoo Linux PHP Version: 4.3.4 Block user comment: N Private report: N New Comment: Actually there seems to be a problem with this function, I am german, and certainly the locale-Pack for de_DE,utf-8 is installed and i can use it for other things like printing dates in the correct language (month-names). But in case of ctype_alpha I get always the answer FALSE if testing a word containing one of the typical german letters ä,ö,ü,ß (and their capital counterparts) .. Previous Comments: ------------------------------------------------------------------------ [2004-03-25 10:44:14] derick@php.net This is not a bug in PHP as PHP uses the OS functions to determine wheather something is an alpha character or not. Also, this has nothing to do with character sets at all, it's just the locale that matters. Do you actually have the et_EE locale installed? Anyway, this is not a bug in PHP. ------------------------------------------------------------------------ [2004-03-24 02:11:25] amd at tt dot ee Description: ------------ ctype_alpha fails to identify at least two iso-8859-15 characters: s-caron (š) and z-caron (ž) and their upper-case equivalents. Reproduce code: --------------- <?php setlocale(LC_ALL,'et_EE'); header("Content-Type: text/html; charset=iso-8859-15;"); $strings = array('äöäaa','sete','ašew', 'aže','üõüä','teŠt','Žombie'); foreach ($strings as $testcase) { if (ctype_alpha($testcase)) { echo "Alpha test - $testcase - PASSED.<br />\n"; } else { echo "Alpha test - $testcase - FAILED.<br />\n"; } } ?> Expected result: ---------------- Alpha test - äöäaa - PASSED. Alpha test - sete - PASSED. Alpha test - ašew - PASSED. Alpha test - aže - PASSED. Alpha test - üõüä - PASSED. Alpha test - teŠt - PASSED. Alpha test - Žombie - PASSED. Actual result: -------------- Alpha test - äöäaa - PASSED. Alpha test - sete - PASSED. Alpha test - ašew - FAILED. Alpha test - aže - FAILED. Alpha test - üõüä - PASSED. Alpha test - teŠt - FAILED. Alpha test - Žombie - FAILED. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=27668&edit=1

« previous php.bugs (#163789) next »