I'm diagnosing some user problems with German locales. Running
php -r "setlocale(LC_ALL, array('de_DE','deu_deu)); echo 10.01;"
gives
10.01
Running
<?php
echo(setlocale(LC_ALL,array('de_DE','deu_deu')));
echo 10.01;
via WAMP stack gives
German_Germany.1252 10,01
This shows that locale is active and the decimal_point has changed.
Is it a known restricting that setlocale
doesn't work in CLI?
After opening an issue with PHP it turns indeed out to be a bug: https://bugs.php.net/bug.php?id=65230
Funny (or rather not) is that obviously broken behavior won't get fixed or even documented:
And after all, locale has such issues on any platform. The solution is to use intl or custom localization functionality.