src/Peach/DF/JsonCodec.php
public function encodeCodePoint($num)
    {
        // @codeCoverageIgnoreStart
        static $hexList = array(
            0x3C => self::HEX_TAG,
            0x3E => self::HEX_TAG,
            0x26 => self::HEX_AMP,
            0x27 => self::HEX_APOS,
            0x22 => self::HEX_QUOT,
        );
        static $encodeList = array(
            0x22 => "\\\"",
            0x5C => "\\\\",
            0x08 => "\\b",
            0x0C => "\\f",
            0x0A => "\\n",
            0x0D => "\\r",
            0x09 => "\\t",
        );
        // @codeCoverageIgnoreEnd
        
        if (array_key_exists($num, $hexList) && $this->getEncodeOption($hexList[$num])) {
            return "\\u00" . strtoupper(dechex($num));
        }
        if (array_key_exists($num, $encodeList)) {
            return $encodeList[$num];
        }
        if ($num === 0x2F) {
            return $this->getEncodeOption(self::UNESCAPED_SLASHES) ? "/" : "\\/";
        }
        if (0x20 <= $num && $num < 0x80) {
            return chr($num);
        }
        if (0x80 <= $num && $this->getEncodeOption(self::UNESCAPED_UNICODE)) {
            return $this->utf8Codec->encode($num);
        }
        return "\\u" . str_pad(dechex($num), 4, "0", STR_PAD_LEFT);
    }
public function encodeCodePoint($num)
    {
        // @codeCoverageIgnoreStart
        static $hexList = array(
            0x3C => self::HEX_TAG,
            0x3E => self::HEX_TAG,
            0x26 => self::HEX_AMP,
            0x27 => self::HEX_APOS,
            0x22 => self::HEX_QUOT,
        );
        static $encodeList = array(
            0x22 => "\\\"",
            0x5C => "\\\\",
            0x08 => "\\b",
            0x0C => "\\f",
            0x0A => "\\n",
            0x0D => "\\r",
            0x09 => "\\t",
        );
        // @codeCoverageIgnoreEnd
        
        if (array_key_exists($num, $hexList) && $this->getEncodeOption($hexList[$num])) {
            return "\\u00" . strtoupper(dechex($num));
        }
        if (array_key_exists($num, $encodeList)) {
            return $encodeList[$num];
        }
        if ($num === 0x2F) {
            return $this->getEncodeOption(self::UNESCAPED_SLASHES) ? "/" : "\\/";
        }
        if (0x20 <= $num && $num < 0x80) {
            return chr($num);
        }
        if (0x80 <= $num && $this->getEncodeOption(self::UNESCAPED_UNICODE)) {
            return $this->utf8Codec->encode($num);
        }
        return "\\u" . str_pad(dechex($num), 4, "0", STR_PAD_LEFT);
    }
指定された Unicode 符号点を JSON 文字に変換します.

@param  int $num Unicode 符号点
@return string   指定された Unicode 符号点に対応する文字列
@ignore