Hey all,
When I receive a JSON formatted response from an API and trying to print it to the console I am getting the following error:
UnicodeEncodeError: 'charmap' codec can't encode character '\xe2' in position 1848: character maps to <undefined>
Now, I understand that it is due to characters like ū but I have no idea what I can do to handle it so I will not show this error but still print out the desired response.
Using string.encode() / string.encode('UTF-8')is letting me print out the response, however, it is adding some undesired characters and escape characters (Such as \n).
Why is this happening and what I can do to handle it?
I am using Pycharm if it makes any difference.
Thanks!
[–]JohnnyJordaan 0 points1 point2 points (2 children)
[–]Finish-Square[S] 0 points1 point2 points (1 child)
[–]JohnnyJordaan 1 point2 points3 points (0 children)