How do I get rid of the “u” from a decoded JSON object?

后端 未结 3 2264
深忆病人
深忆病人 2020-12-18 20:07

I have a dictionary of dictionaries in Python:

d = {\"a11y_firesafety.html\":{\"lang:hi\": {\"div1\": \"http://a11y.in/a11y/idea/a11y_firesafety.html:hi\"},          


        
3条回答
  •  悲&欢浪女
    2020-12-18 21:01

    There is no "unicode" encoding, since unicode is a different data type and I don't really see any reason unicode would be a problem, since you may always convert it to string doing e.g. foo.encode('utf-8').

    However, if you really want to have string objects upfront you should probably create your own decoder class and use it while decoding JSON.

提交回复
热议问题