コード例 #1
0
ファイル: utils.py プロジェクト: aligature/GateOne
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
ファイル: utils.py プロジェクト: 10xEngineer/GateOne
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("</", "<\\/")