When downloading activities, the script crashes on activities with "ø" in the name.
Error message:
File`"gcexport.py", line 186, in
print a['activity']['activityName']['value']
File "C:\Anaconda2\lib\encodings\cp437.py", line 12, in encode
return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: 'charmap' codec can't encode character u'\xf8' in position 1: character maps
to \
Tracked it to the
json_results = json.loads(result) on line 169 (or in that area if I have changed the script slightly). Basically writing or printing the result variable shows the ø properly in files or on screen, but the "json_results"-dict shows a unicode stringfor the acitivityName as this
{u'value': u'H\xf8vik Cycling'}
Tested with
print a['activity']['activityName']['value'].encode('utf-8') (also other encodings without luck) but it produces a weird character.
When downloading activities, the script crashes on activities with "ø" in the name. Error message:
Tracked it to the
json_results = json.loads(result)
on line 169 (or in that area if I have changed the script slightly). Basically writing or printing theresult
variable shows the ø properly in files or on screen, but the "json_results"-dict shows a unicode stringfor the acitivityName as thisTested with
print a['activity']['activityName']['value'].encode('utf-8')
(also other encodings without luck) but it produces a weird character.Anyone know how to fix it?