Python: escaping issue with ujson
I am using ujson to convert dictionary to json. w开发者_运维百科hen I run the following line:
ujson.dumps({'key':'val\1'})
I get the following result:
[{"key": "val\\1"}]
while I expect/want it to be:
[{"key": "val\1"}]
any idea?
There is no problem, that's what repr
looks like for this value. It is \1
.
精彩评论