public static function encode($obj, $pretty = false, $html = false)
    {
        $s = json_encode($obj);

        if ($pretty) {
            return self::format($s, $html);
        }

        return $s;
    }