I run this php code:
echo "<br>system locales: ".system('locale -a')."<br><br>";
echo "current locales: ".setlocale(LC_ALL, 0)."<br><br>";
var_dump(setlocale (LC_ALL, 'de_DE.utf8'));
echo "current locales: ".setlocale(LC_ALL, 0)."<br><br>";
echo "accepting german characters?: ".ctype_alpha("äüöß")."<br><br>";
echo "accepting characters in general?: ".ctype_alpha("test")."<br><br>";
echo "rejecting numbers?: ".ctype_alpha("tes2t")."<br><br>";
and get this output:
C C.UTF-8 POSIX de_DE.utf8
system locales: de_DE.utf8
current locales: C
string(10) "de_DE.utf8" current locales: de_DE.utf8
accepting german characters?:
accepting characters in general?: 1
rejecting numbers?
I expected that after the call to setlocale (LC_ALL, 'de_DE.utf8') ctype_alpha would accept german characters like äöüß, as written in the documentation: "Returns TRUE if every character in text is a letter from the current locale, FALSE otherwise." but it doesn't. What am i doing wrong here?
PHP Version is : 5.3.10-1ubuntu3.8