Revision 14537
Added by Aaron Marcuse-Kubitza over 10 years ago
trunk/lib/strings.py | ||
---|---|---|
114 | 114 |
def json_encode(str_): |
115 | 115 |
return replace_all(json_encode_map, esc_quotes(str_, '"')) |
116 | 116 |
|
117 |
def json_decode(str_): return str_.decode('string_escape') |
|
118 |
|
|
117 | 119 |
def esc_for_mogrify(query): |
118 | 120 |
'''Escapes a query right before being passed to a mogrifying function.''' |
119 | 121 |
return query.replace('%', '%%') |
Also available in: Unified diff
lib/strings.py: added json_decode()