Python - Unicode issue while using json.loads

The name of the pictureThe name of the pictureThe name of the pictureClash 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





Have you tried printing u'xc2ccounts' ? it is only a representation for Âccounts. I see no issue here
– gogaz
Aug 10 at 10:15



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.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard