My server only offers Python v2.7.5.
This script is working:
import jsonwith open('Ranger_Policies.json', 'r') as f: data = json.loads(f.read())for p in data['policies']: print "Service:", p['service'] #, "Name:", p['name']
When I remove the comment-mark, the p['name']
triggs an error:
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 29: ordinal not in range(128)
How to correct this specific source code, it must work with any standard UTF8 for Latin.