Python Forum

Full Version: A question about encoding
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I had to add .encode('utf-8') to the end of a string containing vowels with macrons (ā and ē) to prevent my Kivy app from crashing, but these characters are not rendered properly in the app now. ē appears as \xc4\x93 and the string has been converted into a bytes literal. How do I prevent this?
If you provide some code and the actual error text when you exclude the .encode('utf-8) you might get some responses. As is your question is too nebulous