DiffMatchPatch\Utils::unicodeChr PHP Method

unicodeChr() public static method

Multibyte replacement for standard chr()
public static unicodeChr ( integer $code ) : string
$code integer Character code.
return string Char with given code
    public static function unicodeChr($code)
    {
        // TODO this works by order of magnitude slower then chr()
        $code = sprintf("%04x", $code);
        $char = json_decode('"\\u' . $code . '"');
        $char = iconv('UTF-8', mb_internal_encoding(), $char);
        return $char;
    }