From b8a7c9f942f5e8403f910857f81aed4f5e268ae1 Mon Sep 17 00:00:00 2001 From: Benjamin Mack Date: Tue, 9 Oct 2012 16:36:10 +0200 Subject: [PATCH] [BUGFIX] Use UTF-8 by default in Flexforms and Backend For FlexForm tools (used internally) and for backend use, the encoding is always utf-8, so some checks can be removed and functions can be deprecated. Change-Id: I2a83b155d164ce5c4076b06bfbc219d7dd09fc38 Releases: 6.0 Resolves: #41793 Reviewed-on: http://review.typo3.org/15446 Reviewed-by: Dmitry Dulepov Tested-by: Dmitry Dulepov --- .../backend/Classes/Template/DocumentTemplate.php | 11 ++++------- .../Classes/Configuration/FlexForm/FlexFormTools.php | 2 +- .../core/Classes/Resource/Driver/LocalDriver.php | 5 +---- .../core/Classes/Utility/File/BasicFileUtility.php | 5 +---- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/typo3/sysext/backend/Classes/Template/DocumentTemplate.php b/typo3/sysext/backend/Classes/Template/DocumentTemplate.php index defa3ca474e..2ab0bbcd17d 100644 --- a/typo3/sysext/backend/Classes/Template/DocumentTemplate.php +++ b/typo3/sysext/backend/Classes/Template/DocumentTemplate.php @@ -246,12 +246,10 @@ class DocumentTemplate { */ public $parseTimeFlag = 0; - // INTERNAL - // Default charset. see function initCharset() /** - * @todo Define visibility + * internal character set, nowadays utf-8 for everything */ - public $charset = 'utf-8'; + protected $charset = 'utf-8'; // Internal: Indicates if a
-output section is open /** @@ -737,7 +735,6 @@ class DocumentTemplate { } } // Send HTTP header for selected charset. Added by Robert Lemke 23.10.2003 - $this->initCharset(); header('Content-Type:text/html;charset=' . $this->charset); // Standard HTML tag $htmlTag = ''; @@ -1236,10 +1233,10 @@ class DocumentTemplate { * * @return string tag with charset from $this->charset or $GLOBALS['LANG']->charSet * @todo Define visibility + * @deprecated since TYPO3 6.0, remove in 6.2. The charset is utf-8 all the time for the backend now */ public function initCharset() { - // Set charset to the charset provided by the current backend users language selection: - $this->charset = $GLOBALS['LANG']->charSet ? $GLOBALS['LANG']->charSet : $this->charset; + \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction(); // Return meta tag: return ''; } diff --git a/typo3/sysext/core/Classes/Configuration/FlexForm/FlexFormTools.php b/typo3/sysext/core/Classes/Configuration/FlexForm/FlexFormTools.php index 4fd009f5f7d..f8d17e11b14 100644 --- a/typo3/sysext/core/Classes/Configuration/FlexForm/FlexFormTools.php +++ b/typo3/sysext/core/Classes/Configuration/FlexForm/FlexFormTools.php @@ -408,7 +408,7 @@ class FlexFormTools { $spaceInd = $GLOBALS['TYPO3_CONF_VARS']['BE']['compactFlexFormXML'] ? -1 : 4; $output = \TYPO3\CMS\Core\Utility\GeneralUtility::array2xml($array, '', 0, 'T3FlexForms', $spaceInd, $options); if ($addPrologue) { - $output = 'charSet . '" standalone="yes" ?>' . LF . $output; + $output = '' . LF . $output; } return $output; } diff --git a/typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php b/typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php index e90eabcca54..52a00d78211 100644 --- a/typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php +++ b/typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php @@ -258,11 +258,8 @@ class LocalDriver extends \TYPO3\CMS\Core\Resource\Driver\AbstractDriver { if (!$charset) { if (TYPO3_MODE === 'FE') { $charset = $GLOBALS['TSFE']->renderCharset; - } elseif (is_object($GLOBALS['LANG'])) { - // BE assumed: - $charset = $GLOBALS['LANG']->charSet; } else { - // best guess + // default for Backend $charset = 'utf-8'; } } diff --git a/typo3/sysext/core/Classes/Utility/File/BasicFileUtility.php b/typo3/sysext/core/Classes/Utility/File/BasicFileUtility.php index 048f1ce1bcd..5490741b20b 100644 --- a/typo3/sysext/core/Classes/Utility/File/BasicFileUtility.php +++ b/typo3/sysext/core/Classes/Utility/File/BasicFileUtility.php @@ -517,11 +517,8 @@ class BasicFileUtility { if (!$charset) { if (TYPO3_MODE == 'FE') { $charset = $GLOBALS['TSFE']->renderCharset; - } elseif (is_object($GLOBALS['LANG'])) { - // BE assumed: - $charset = $GLOBALS['LANG']->charSet; } else { - // best guess + // Backend $charset = 'utf-8'; } } -- 2.20.1