protected function compileCharacter($char)
    {
        switch (true) {
            case preg_match('(^U\\+[0-9a-fA-F]{4}$)', $char):
                return $this->converter->toUTF8Character(hexdec(substr($char, 2)));

            case preg_match('(^[0-9a-fA-F]{2}$)', $char):
                return chr(hexdec($char));

            default:
                throw new RuntimeException("Invalid character definition: $char");
        }
    }
protected function compileCharacter($char)
    {
        switch (true) {
            case preg_match('(^U\\+[0-9a-fA-F]{4}$)', $char):
                return $this->converter->toUTF8Character(hexdec(substr($char, 2)));

            case preg_match('(^[0-9a-fA-F]{2}$)', $char):
                return chr(hexdec($char));

            default:
                throw new RuntimeException("Invalid character definition: $char");
        }
    }
protected function compileCharacter ( $ char ) { switch ( true ) { case preg_match ( '(^U\\+[0-9a-fA-F]{4}$)' , $ char ) : return $ this -> converter -> toUTF8Character ( hexdec ( substr ( $ char , 2 ) ) ) ; case preg_match ( '(^[0-9a-fA-F]{2}$)' , $ char ) : return chr ( hexdec ( $ char ) ) ; default : throw new RuntimeException ( "Invalid character definition: $char" ) ; } }
Compile a single source character definition into a plain UTF-8 character.

Handles the two formats from the possible character definitions:
- U+xxxx : Unicode value in hexadecimal
- xx: Ascii value in hexadecimal

@param string $char

@return string
Compile a single source character definition into a plain UTF - 8 character .