3👍
The problem is that your input is not UTF-8! The hex code 0xe2
is a continuation byte in UTF-8, which would require another hex character to be legal. However the hex code 0xe2
is â
in Windows-1252. Just ensure that you properly decode the byte stream using Windows-1252 (called cp1252
in Python):
text.decode('cp1252')
0👍
Here there is some doc about JSON renders. I suspect the problem has to do with the fact the code you have posted
data = stream.read().decode(encoding)
is trying to decode an already decoded string, since you are using UnicodeJsonRenderer. If you visit the link, you will realize that UnicodeJsonRenderer has no charset. So, you can’t decode it.
Try using another like JsonPRenderer or HTMLFormRenderer
Source:stackexchange.com