private static function Unescaper::utf8chr in Plug 7
Get the UTF-8 character for the given code point.
Parameters
int $c The unicode code point:
Return value
string The corresponding UTF-8 character
1 call to Unescaper::utf8chr()
- Unescaper::unescapeCharacter in lib/
Symfony/ yaml/ Symfony/ Component/ Yaml/ Unescaper.php - Unescapes a character that was found in a double-quoted string.
File
- lib/
Symfony/ yaml/ Symfony/ Component/ Yaml/ Unescaper.php, line 127
Class
- Unescaper
- Unescaper encapsulates unescaping rules for single and double-quoted YAML strings.
Namespace
Symfony\Component\YamlCode
private static function utf8chr($c) {
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);
}