Bug #23596
closedCLI dispatcher uses the locale from the shell
0%
Description
The locale (particularly, LC_NUMERIC (which is part of LC_ALL)) has an effect on how numbers are parsed. For example, the following code
$foo = floatval('3.14159');
will result in 3.14159 for the "C" locale (or an English locale) and in 3 for any Germany locale.
When running TYPO3 via Apache (ie., using the FE or normal BE), this is no problem as PHP by default does not have a particular locale set. However, when running TYPO3 via the CLI mode, the locale used in the shell is used - and that often is something like "DE_de.utf8".
So we need to reset the locale to make sure numbers are parsed correctly (and to have a clean slate).
This affects all branches 4.2, 4.2, 4.4 and the trunk.
I have only tested this on Linux. We'll also need testing on Windows and Mac OS.
(issue imported from #M15790)
Files
Updated by Ernesto Baschny about 14 years ago
I think this is pretty intrusive, as there is then no way to specifically change the locale for running certain CLI scripts. We have some scripts which do operations requiring a specific (utf-8) locale set, for example, else they break.
If there are problems, the caller could reset the locale on his own.
Another option would be to configure a locale through $TYPO3_CONF_VARS, so the user wanting this behaviour could specifically set it to "C" there.
Updated by Dmitry Dulepov over 13 years ago
- Status changed from Needs Feedback to Closed
No feedback provided within 90 days. Closing the issue.