The code originates from the eZUTF8Codec class available in lib/ezi18n/classes/ezutf8codec.php
 /**
  * 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}");
     }
 }