UnicodeDecodeError: 'utf8' codec can't decode byte
-- encoding: utf-8
Is changing only encoding of the source file, meaning you can define variables/comments using non-ascii chars. 
You can try to use 
json.dumps(..., ensure_ascii=False, encoding="ISO-8859-1")
I'm using Django and ajax to print data to an HTML table with jQuery and JSON.
It was working until new data came and had "ú@ñ" type of characters and I got: 
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf9 in position 4: invalid start byte
I've read and tried many different possible reasons and it's still not working. 
I've tried:

saving my file in UTF-8 in Sublime Text and with a file -bi myfile I still get text/x-python; charset=us-ascii
using # -*- encoding: utf-8 -*- at the beginning of my views.py
changing MySQL charset to CHARSET=utf8mb4 from CHARSET=latin1
json.dumps(list(rows), default=datetime_handler), content_type="application/json", encoding='utf-8')

I'd rather avoid using .decode() for every string in my data but if there's no other solution, it's what I'll have to do.