I thought of a workaround which is superior for my purposes. Redirect the downloaded file to the console:curl "url" -H "X-API-Key: key-goes-here" > &3
Where it can be copied and pasted to a new file. If can be then read like this:with open('outfile.json, 'r',encoding='UTF-8') as f:
This has the real advantage of preserving all of the accented vowels, etc. in the rest of the data processing. It turns out the original file was indeed UTF-8, but could not be handled by the ASCII decoder.