note 105688 deleted from function.ctype-alpha by danbrown

From: Date: Wed, 07 Sep 2011 15:39:56 +0000
Subject: note 105688 deleted from function.ctype-alpha by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-183007@lists.php.net to get a copy of this message
Note Submitter: daniel dot rhodes at warpasylum dot co dot uk ---- I'm not having the success that Tyrunur is having with UTF-8. For me, on PHP 5.3.5, it only seems to work when both the locale and the string are ISO-8859-1. Thus: <?php //script file itself its UTF-8 $utf8_string = 'jérômecaractèresdelachaîne'; $iso_string = iconv('UTF-8', 'ISO-8859-1', $utf8_string); //or: //$iso_string = mb_convert_encoding($utf8_string, 'ISO-8859-1', 'UTF-8'); setlocale(LC_ALL, 'fr_FR.utf8'); var_dump(nl_langinfo(CODESET)); //gives UTF-8 var_dump(ctype_alpha($utf8_string)); //gives FALSE setlocale(LC_ALL, 'fr_FR'); var_dump(nl_langinfo(CODESET)); //gives ISO-8859-1 var_dump(ctype_alpha($iso_string)); //gives TRUE ?> My ctype_alnum() also seems to dislike UTF-8...

« previous php.notes (#183007) next »