I use Pylons framework, Mako for web application. I was not too worried about how Python handles unicode strings. I had a tense moment when I saw how my site crashed when a page was displayed, and later I found out that this was due to UnicodeDecodeError .
After looking at the error, I started to create a grid around my Python code, adding encoding, decoding calls for the line with the parameter “ignore”, but still I could not see that there were errors once.
Finally, I used to decode ascii with ignore and made the site without any glitches.
Login to my site goes through many sites. This means that I do not control the languages or the language of choice. My site supports international languages and English. I have feed aggregation that usually doesn't bother with unicode / ascii / utf-8. While I show the text through the mako template, I show it as it is.
Not being a web expert, what are the best string handling methods in a Python project? Should I only care about rendering the text or the entire application phase?
user90150
source share