1. JSON. Loads (JSON_ Json.decoder.jsondecodeerror: invalid control character at: Line 2 column 18 (char 19)
reason: JSON uses rigorous format by default, which is easy to report when data is transferred across languages
solution: add the parameter strict
json.loads(json_data, strict=False)
2. JSON. Dumps (data) to convert Chinese characters into Unicode
reason: JSON performs character conversion by default
solution: add ensure_ ASCII parameter
json.dumps(data, ensure_ascii=False)
3. JSON. Loads (JSON_ Error: JSON. Decoder. Jsondecodeerror: invalid – escape: Line 1 column 89 (char 88)
Error reason: syntax error
Solutions
Check JSON_ Data data, whether it contains illegal characters, such as backslash ‘\’, change ‘\’ to ‘\ \’
Similar Posts:
- Python JSON error json.decoder.jsondecodeerror Chinese
- [Solved] JSON check syntax error: json.decoder.JSONDecodeError: Invalid control character at: line 1 column
- Python: How to Solve raise JSONDecodeError(“Expecting value”, s, err.value) from None json.decoder…
- [Solved] json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
- [Solved] TypeError: string indices must be integers, not str
- [Solved] json.decoder.JSONDecodeError: Expecting ‘,‘ delimiter: line xx column xx (char xxx)
- SyntaxError: Non-ASCII character ‘\xe2‘ in file
- TypeError: Object of type ‘datetime‘ is not JSON serializable [Solved]
- TypeError: the JSON object must be str, not ‘bytes’