diff --git a/typo3/sysext/core/Classes/Charset/CharsetConverter.php b/typo3/sysext/core/Classes/Charset/CharsetConverter.php index faa06816fc262507e86c13a34f122246f3a43583..bfababa89934e0c5e74bf0b6747d83df9cb47e7a 100644 --- a/typo3/sysext/core/Classes/Charset/CharsetConverter.php +++ b/typo3/sysext/core/Classes/Charset/CharsetConverter.php @@ -317,11 +317,11 @@ class CharsetConverter implements SingletonInterface } // PHP-libs don't support fallback to SGML entities, but UTF-8 handles everything if ($toCharset === 'utf-8' || !$useEntityForNoChar) { + // Returns FALSE for unsupported charsets $convertedString = mb_convert_encoding($inputString, $toCharset, $fromCharset); if (false !== $convertedString) { return $convertedString; } - // Returns FALSE for unsupported charsets } if ($fromCharset !== 'utf-8') { $inputString = $this->utf8_encode($inputString, $fromCharset); @@ -1194,9 +1194,11 @@ class CharsetConverter implements SingletonInterface * @param int $len The byte length * @return string The shortened string * @see mb_strcut() + * @deprecated since TYPO3 v8, will be removed with TYPO3 v9, use mb_strcut() directly */ public function strtrunc($charset, $string, $len) { + GeneralUtility::logDeprecatedFunction(); if ($len <= 0) { return ''; } diff --git a/typo3/sysext/core/Documentation/Changelog/8.5/Deprecation-78670-DeprecatedCharsetConverterMethods.rst b/typo3/sysext/core/Documentation/Changelog/8.5/Deprecation-78670-DeprecatedCharsetConverterMethods.rst index 0487c74fcbe197d1e010cd02071cde516c623a58..503ca47aefb03f877f0322ba5bb23df006eb1c8c 100644 --- a/typo3/sysext/core/Documentation/Changelog/8.5/Deprecation-78670-DeprecatedCharsetConverterMethods.rst +++ b/typo3/sysext/core/Documentation/Changelog/8.5/Deprecation-78670-DeprecatedCharsetConverterMethods.rst @@ -14,6 +14,7 @@ Therefore some methods of :php:`CharsetConverter` have been marked as deprecated - :php:`strlen()`: use :php:`mb_strlen()` directly - :php:`substr()`: use :php:`mb_substr()` directly +- :php:`strtrunc()`: use :php:`mb_strcut()` directly - :php:`convCapitalize()`: use :php:`mb_convert_case()` directly - :php:`conv_case()`: use :php:`mb_strtolower()` or :php:`mb_strtoupper()` directly - :php:`utf8_substr()`: use :php:`mb_substr()` directly