Revert "[CLEANUP] Rework/simplify copyright header and remove @package"
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Classes / ViewHelpers / Format / AbstractEncodingViewHelper.php
1 <?php
2 namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
3
4 /* *
5 * This script is part of the TYPO3 project - inspiring people to share! *
6 * *
7 * TYPO3 is free software; you can redistribute it and/or modify it under *
8 * the terms of the GNU General Public License version 2 as published by *
9 * the Free Software Foundation. *
10 * *
11 * This script is distributed in the hope that it will be useful, but *
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
13 * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
14 * Public License for more details. *
15 * */
16 /**
17 * This is the base class for ViewHelpers that work with encodings.
18 * Currently that are format.htmlentities, format.htmlentitiesDecode and format.htmlspecialchars
19 */
20 abstract class AbstractEncodingViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper {
21
22 /**
23 * @var string
24 */
25 static protected $defaultEncoding = NULL;
26
27 /**
28 * Resolve the default encoding. If none is set in Frontend or Backend, uses UTF-8.
29 *
30 * @return string the encoding
31 */
32 protected function resolveDefaultEncoding() {
33 if (self::$defaultEncoding === NULL) {
34 self::$defaultEncoding = 'UTF-8';
35 }
36 return self::$defaultEncoding;
37 }
38 }