Issue Bug Closed

#75141config.locale_all does not set LC_ALL

Christian Welzel 03/16/16, 10:29 updated 10/02/18, 11:18

Description

Using the following code in my php code i get not the correct output:

$s = sprintf(“%.2f”, 5.00);

config.locale_all is set to “de_DE.utf-8”, so i would expect sprintf to return “5,00” but “5.00” is returned.
Looking into TypoScriptFrontendController.php::settingLocale() reveals, that only LC_CTYPE, LC_MONETARY and LC_TIME are set
to the value given to locale_all. But not LC_NUMERIC.

A comment in the file says: There’s a problem that PHP parses float values in scripts wrong if the locale LC_NUMERIC is set
to something with a comma as decimal point Do we set all except LC_NUMERIC

Is this still true in PHP 5.5+?
If yes, than documentation should be updated, as it says “PHP: setlocale(“LC_ALL”, [value]);“
If not, the code should be updated to set LC_ALL instead of only a subset.

Reviews 2