Invalid control character with Python json.loads

后端 未结 3 971
别那么骄傲
别那么骄傲 2020-12-28 12:20

Below is my string that is getting printed out with the below code -

jsonString = data.decode(\"utf-8\")

print jsonString

And below is the

3条回答
  •  轮回少年
    2020-12-28 12:44

    There is no error in your json text.

    You can get the error if you copy-paste the string into your Python source code as a string literal. In that case \n is interpreted as a single character (newline). You can fix it by using raw-string literals instead (r'', Use triple-quotes r'''..''' to avoid escaping "' quotes inside the string literal).

提交回复
热议问题