I am setting a python API to feed android app with java. the output API is JSON. I try to produce a pure Unicode string. I want to literally produce Unicode string without any double backslash.
This is what I want to produce :
\u003chead\u003e
I tried decode but result in double backslash.
b'\u003chead\u003e'.decode('utf-8')
result
\\\\u003chead\\\\u003e
While I want exactly.
\u003chead\u003e
Printed or exported in JSON. I am using python 3.6
Full code
import json
abc = {"me": b"\u003chead\u003e".decode('utf-8')}
json.dumps(abc)
result
{"me": "\\u003chead\\u003e"}
I want
{"me": "\u003chead\u003e"}