示例#1
0
def json_encode(obj):
    """
    On some platforms (CentOS 6.2, specifically) `tornado.escape.json_decode`
    doesn't seem to work just right when it comes to returning unicode strings.
    This is just a wrapper that ensures that the returned string is unicode.
    """
    return unicode(_json_encode(obj))
示例#2
0
def json_encode(obj):
    """
    On some platforms (CentOS 6.2, specifically) `tornado.escape.json_decode`
    doesn't seem to work just right when it comes to returning unicode strings.
    This is just a wrapper that ensures that the returned string is unicode.
    """
    return to_unicode(_json_encode(obj))
示例#3
0
def json_encode(value, _minify=minify_v8):
    return _minify(_json_encode(value))
示例#4
0
def json_encode(value):
    return _json_encode(recursive_unicode(value)).replace("</", "<\\/")