diff options
| author | Greg Roach <greg@subaqua.co.uk> | 2026-02-06 10:53:59 +0000 |
|---|---|---|
| committer | Greg Roach <greg@subaqua.co.uk> | 2026-02-06 10:53:59 +0000 |
| commit | 1e12bba2ff16616c8813810f50730aa8a0fb7985 (patch) | |
| tree | d47cc78778b673fb96aef2311dfd7fb444b29a3e | |
| parent | 4b795a9ce6f86438bd1dcb40dbef2e527d30c2ae (diff) | |
| download | webtrees-1e12bba2ff16616c8813810f50730aa8a0fb7985.tar.gz webtrees-1e12bba2ff16616c8813810f50730aa8a0fb7985.tar.bz2 webtrees-1e12bba2ff16616c8813810f50730aa8a0fb7985.zip | |
Remove dead code
| -rw-r--r-- | app/Encodings/UTF8.php | 37 | ||||
| -rw-r--r-- | tests/app/Encodings/AnselTest.php | 2 |
2 files changed, 1 insertions, 38 deletions
diff --git a/app/Encodings/UTF8.php b/app/Encodings/UTF8.php index 25a77f2ca6..0c424555fd 100644 --- a/app/Encodings/UTF8.php +++ b/app/Encodings/UTF8.php @@ -839,41 +839,4 @@ class UTF8 extends AbstractEncoding { return $this->fromUtf8($text); } - - /** - * Create a UTF8 character from a code. - * - * @param int $code - * - * @return string - */ - public static function chr(int $code): string - { - if ($code < 0 || $code > 0x1FFFFF) { - throw new InvalidArgumentException((string)$code); - } - - if ($code <= 0x7F) { - return chr($code); - } - - if ($code <= 0x7FF) { - return - chr(($code >> 6) + 0xC0) . - chr(($code & 0x3F) + 0x80); - } - - if ($code <= 0xFFFF) { - return - chr(($code >> 12) + 0xE0) . - chr((($code >> 6) & 0x3F) + 0x80) . - chr(($code & 0x3F) + 0x80); - } - - return - chr(($code >> 18) + 0xF0) . - chr((($code >> 12) & 0x3F) + 0x80) . - chr((($code >> 6) & 0x3F) + 0x80) . - chr(($code & 0x3F) + 0x80); - } } diff --git a/tests/app/Encodings/AnselTest.php b/tests/app/Encodings/AnselTest.php index cc728c5a97..87396f67e8 100644 --- a/tests/app/Encodings/AnselTest.php +++ b/tests/app/Encodings/AnselTest.php @@ -141,7 +141,7 @@ class AnselTest extends TestCase foreach ($latin_code_blocks as $codes) { foreach ($codes as $code) { - $utf8 = UTF8::chr($code); + $utf8 = mb_chr($code, 'UTF-8'); $norm = normalizer_normalize($utf8, Normalizer::FORM_D); self::assertIsString($norm); |
