Python - Unicode issue while using json.loads
Clash Royale CLAN TAG#URR8PPP
Python - Unicode issue while using json.loads
I have the following input in a request
"input" :
"skill" : ["java","Âccounts"],
"cleanText" : "I am looking for a hardworking and experienced developer"
,
"count" : 10
I am using flask so I get the request content by the following way
inp = flask.request.data
And I am converting it to json by the following json library
inp = json.loads(inp)
And I get the following json object as output
u'count': 10, u'input': u'skill': [u'java', u'xc2ccounts'], u'cleanText': u'I am looking for a hardworking and experienced developer'
We can see that Âccounts
is replaced by u'xc2ccounts
. I have already tried to decode the string to UTF-8 and passed it to the loads function and had no luck.
I want the exact Âccounts
returned from the json.loads
function. If it is not possible is there an another way to get the json object input dictionary exactly from the string?
Âccounts
u'xc2ccounts
Âccounts
json.loads
u'xc2ccounts'
Âccounts
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Have you tried printing
u'xc2ccounts'
? it is only a representation forÂccounts
. I see no issue here– gogaz
Aug 10 at 10:15