0

I have the following json:

{"Rotações": "string"}

And this python script with the corresponding result:

import json

with open('apaga.json') as jsonin:
    jsondict = json.load(jsonin)

print(jsondict)

> {'Rotações': 'string'}

So I don't know how to call this Rotações key, since it corresponds to Rotações.

The following does not work:

print(jsondict['Rotações'.encode('latin')])

> KeyError: b'Rota\xe7\xf5es'
0

1 Answer 1

0

Try decoding to "utf-8"

Ex:

print(jsondict['Rotações'.decode('utf-8')])

Tested in python2.7

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.