src/N3Lexer.php
private function unescape($item) {
        return preg_replace_callback($this->escapeSequence, function ($match) {
            $sequence = $match[0];
            $unicode4 = isset($match[1])?$match[1]:null;
            $unicode8 = isset($match[2])?$match[2]:null;
            $escapedChar = isset($match[3])?$match[3]:null;
            $charCode;
            if ($unicode4) {
                $charCode = intval($unicode4, 16);
                return mb_convert_encoding('&#' . intval($charCode) . ';', 'UTF-8', 'HTML-ENTITIES');
            }
            else if ($unicode8) {
                $charCode = intval($unicode8, 16);
                return mb_convert_encoding('&#' . intval($charCode) . ';', 'UTF-8', 'HTML-ENTITIES');
            }
            else {
                if (!isset($this->escapeReplacements[$escapedChar]))
                    throw new \Exception();
                return $this->escapeReplacements[$escapedChar];
            }
        },$item);
    }
private function unescape($item) {
        return preg_replace_callback($this->escapeSequence, function ($match) {
            $sequence = $match[0];
            $unicode4 = isset($match[1])?$match[1]:null;
            $unicode8 = isset($match[2])?$match[2]:null;
            $escapedChar = isset($match[3])?$match[3]:null;
            $charCode;
            if ($unicode4) {
                $charCode = intval($unicode4, 16);
                return mb_convert_encoding('&#' . intval($charCode) . ';', 'UTF-8', 'HTML-ENTITIES');
            }
            else if ($unicode8) {
                $charCode = intval($unicode8, 16);
                return mb_convert_encoding('&#' . intval($charCode) . ';', 'UTF-8', 'HTML-ENTITIES');
            }
            else {
                if (!isset($this->escapeReplacements[$escapedChar]))
                    throw new \Exception();
                return $this->escapeReplacements[$escapedChar];
            }
        },$item);
    }
### `_unescape` replaces N3 escape codes by their corresponding characters