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; }