codec can't decode bytes in position 2-3: truncated \uXXXX escape. Step #1: How to solve SyntaxError: (unicode error) 'unicodeescape' - Double slashes for escape Let's start with one of the most frequent examples - windows paths. In this case there is a bad character sequence in the string: import json. Dump to JSON adds additional double quotes and escaping of quotes. You are double encoding your JSON strings. data is already a JSON string, and doesn't need to be encoded again: >>> import json >>> not_encoded = {"created_at":"Fri Aug 08 11:04:40 +0000 2014"} >>> encoded_data = json.dumps (not_encoded) >>> print encoded_data {"created_at. Solutions: Put the string in between double quotes instead of single quotes. Put the escaping character before the single quote in the string. You can use the first solution like this: print ("hello I don't like single quote at all"). To use Json datatype the string being inserted should be a valid and properly formatted Json.. JSON String Escape Unescape. By decoding it converts the u0022 to a double quote which invalidates the json string. Question or problem about Python programming. Insert escaped double quotes into MySQL JSON field. Escape double quote and backslash from a Json string.I am looking for code to escape double quote and backslash.String val='my "test" \string'; after escape it should display. my "test" \string. thanks in advance.January 30, 2017. Backslash in this case is an escape character for quotes.Json format requires key values to be within quotes. If we want to store json string in.