toUTF8Character() public static method

Convert character code to UTF-8 character.
public static toUTF8Character ( integer $charCode ) : string
$charCode integer
return string
 /**
  * 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
  */
 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}");
     }
 }