Project

General

Profile

Actions

Bug #23596

closed

CLI dispatcher uses the locale from the shell

Added by Oliver Klee over 13 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2010-09-24
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

locales.diff (574 Bytes) locales.diff Administrator Admin, 2010-09-24 12:22
Actions #1

Updated by Ernesto Baschny over 13 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.

Actions #2

Updated by Dmitry Dulepov almost 13 years ago

  • Status changed from Needs Feedback to Closed

No feedback provided within 90 days. Closing the issue.

Actions

Also available in: Atom PDF