Show More
@@ -74,6 +74,6 b' def jsonescapeu8fallback(u8chars, parano' | |||||
74 | else: |
|
74 | else: | |
75 | jm = _jsonmap |
|
75 | jm = _jsonmap | |
76 | # non-BMP char is represented as UTF-16 surrogate pair |
|
76 | # non-BMP char is represented as UTF-16 surrogate pair | |
77 | u16codes = array.array('H', u8chars.decode('utf-8').encode('utf-16')) |
|
77 | u16codes = array.array(r'H', u8chars.decode('utf-8').encode('utf-16')) | |
78 | u16codes.pop(0) # drop BOM |
|
78 | u16codes.pop(0) # drop BOM | |
79 | return ''.join(jm[x] if x < 128 else '\\u%04x' % x for x in u16codes) |
|
79 | return ''.join(jm[x] if x < 128 else '\\u%04x' % x for x in u16codes) |
General Comments 0
You need to be logged in to leave comments.
Login now