2 namespace TYPO3\CMS\Core\Encoder;
57 $this->charsetConversion = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Charset\CharsetConverter::class);
58 for ($i = 0; $i < 256; $i++) {
59 if ($i >= ord(
'0') && $i <= ord(
'9') || $i >= ord(
'A') && $i <= ord(
'Z') || $i >= ord(
'a') && $i <= ord(
'z')) {
60 $this->hexMatrix[$i] = null;
62 $this->hexMatrix[$i] = dechex($i);
75 $stringLength = $this->charsetConversion->strlen(
'utf-8', $input);
77 for ($i = 0; $i < $stringLength; $i++) {
78 $c = $this->charsetConversion->substr(
'utf-8', $input, $i, 1);
81 return $encodedString;
99 $ordinalValue = $this->charsetConversion->utf8CharToUnumber($character);
106 if ($ordinalValue < 256) {
107 $pad = substr(
'00', strlen($hex));
108 return '\\x' . $pad . strtoupper($hex);
111 $pad = substr(
'0000', strlen($hex));
112 return '\\u' . $pad . strtoupper($hex);
123 return in_array($character, $this->immuneCharacters,
true);
138 if ($ordinalValue <= 255) {
139 return $this->hexMatrix[$ordinalValue];
141 return dechex($ordinalValue);