Project

General

Profile

Actions

Bug #46118

closed

Epic #72333: Clean up charset conversion and language service

Overriding _LOCAL_LANG in TS broken for fluid templates

Added by Dmitriy Simakov almost 12 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Localization
Target version:
-
Start date:
2013-03-08
Due date:
% Done:

0%

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

Description

I'm using news extension, and overriding several labels in TS via plugin.tx_news._LOCAL_LANG.ru.*
That worked in 4.6 with forceCharset, since there was a code in sysext/extbase/Classes/Utility/Localization.php:

// For labels coming from the TypoScript (database) the charset is assumed to be "forceCharset" and if that is not set, assumed to be that of the individual system languages
if (isset($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']) && strlen($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']) > 0) {
        self::$LOCAL_LANG_charset[$extensionName][$languageKey][$labelKey] = $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'];
}

I.e. encoding of _LOCAL_LANG labels set from TypoScript was always assumed as utf-8 (if forceCharset=utf-8)
However, that code disappeared in 4.7. And now this code has an effect:
self::$LOCAL_LANG_charset[$extensionName][$languageKey][$labelKey] = $GLOBALS['LANG']->csConvObj->charSetArray[$languageKey];

But csConvObj, which is t3lib_cs in t3lib/class.t3lib_cs.php, defines charset encoding for russian language as "windows-1251"
var $charSetArray = array(
        'ru' => 'windows-1251',

So, labels from TypoScript templates, which are in utf-8 (since BE encoding is utf-8) are encoded as if they had windows-1251 encoding in sysext/extbase/Classes/Utility/Localization.php:
$value = self::convertCharset($value, self::$LOCAL_LANG_charset[$extensionName][self::$languageKey][$key]);

I guess, it's a good time to change charset to utf-8 in t3lib_cs, for 'ru' at least.

Also, extensions not using extbase, like sr_freecap, are working ok with overriden _LOCAL_LANG labels

Actions

Also available in: Atom PDF