Show More
@@ -387,8 +387,8 class normcasespecs(object): | |||||
387 | other = 0 |
|
387 | other = 0 | |
388 |
|
388 | |||
389 | _jsonmap = [] |
|
389 | _jsonmap = [] | |
390 |
_jsonmap.extend("\\u%04x" % x for x in |
|
390 | _jsonmap.extend("\\u%04x" % x for x in range(32)) | |
391 |
_jsonmap.extend(chr(x) for x in |
|
391 | _jsonmap.extend(chr(x) for x in range(32, 127)) | |
392 | _jsonmap.append('\\u007f') |
|
392 | _jsonmap.append('\\u007f') | |
393 | _jsonmap[0x09] = '\\t' |
|
393 | _jsonmap[0x09] = '\\t' | |
394 | _jsonmap[0x0a] = '\\n' |
|
394 | _jsonmap[0x0a] = '\\n' | |
@@ -400,7 +400,7 class normcasespecs(object): | |||||
400 | _paranoidjsonmap = _jsonmap[:] |
|
400 | _paranoidjsonmap = _jsonmap[:] | |
401 | _paranoidjsonmap[0x3c] = '\\u003c' # '<' (e.g. escape "</script>") |
|
401 | _paranoidjsonmap[0x3c] = '\\u003c' # '<' (e.g. escape "</script>") | |
402 | _paranoidjsonmap[0x3e] = '\\u003e' # '>' |
|
402 | _paranoidjsonmap[0x3e] = '\\u003e' # '>' | |
403 |
_jsonmap.extend(chr(x) for x in |
|
403 | _jsonmap.extend(chr(x) for x in range(128, 256)) | |
404 |
|
404 | |||
405 | def jsonescape(s, paranoid=False): |
|
405 | def jsonescape(s, paranoid=False): | |
406 | '''returns a string suitable for JSON |
|
406 | '''returns a string suitable for JSON |
General Comments 0
You need to be logged in to leave comments.
Login now