function Unescaper::utf8chr
Get the UTF-8 character for the given code point.
File
-
vendor/
symfony/ yaml/ Unescaper.php, line 94
Class
- Unescaper
- Unescaper encapsulates unescaping rules for single and double-quoted YAML strings.
Namespace
Symfony\Component\YamlCode
private static function utf8chr(int $c) : string {
if (0x80 > ($c %= 0x200000)) {
return \chr($c);
}
if (0x800 > $c) {
return \chr(0xc0 | $c >> 6) . \chr(0x80 | $c & 0x3f);
}
if (0x10000 > $c) {
return \chr(0xe0 | $c >> 12) . \chr(0x80 | $c >> 6 & 0x3f) . \chr(0x80 | $c & 0x3f);
}
return \chr(0xf0 | $c >> 18) . \chr(0x80 | $c >> 12 & 0x3f) . \chr(0x80 | $c >> 6 & 0x3f) . \chr(0x80 | $c & 0x3f);
}