[Python-Dev] Changes to logging

Vinay Sajip vinay_sajip@red-dove.com
Sun, 16 Feb 2003 15:19:55 -0000


> You should use sys.getdefaultencoding() for this. Python's default
> encoding is "ascii", BTW, not "latin-1".
>

OK, but supposing I log a message with the format string u"Marc-Andr\xe9".
If I use "ascii" as the encoding, an exception is raised because the code
for e-acute is > 128. How best should this situation be handled? I assumed
that people would be using Unicode to log messages in other languages with
accented characters etc. which are typically outside the ASCII range.

Regards,

Vinay Sajip