[EMAIL PROTECTED] wrote: > On Jan 30, 11:28 pm, Walter Dörwald <[EMAIL PROTECTED]> wrote: > >> codecs.register_error("transliterate", transliterate) >> >> Walter > > Really, really slick solution. > Though, why was it [:1], not [0]? ;-)
No particular reason, unicodedata.normalize("NFD", ...) should never return an empty string. > And one more thing: >> def transliterate(exc): >> if not isinstance(exc, UnicodeEncodeError): >> raise TypeError("don'ty know how to handle %r" % r) > I don't understand what %r and r are and where they are from. The man > 3 printf page doesn't have %r formatting. %r means format the repr() result, and r was supposed to be exc. ;) Servus, Walter -- http://mail.python.org/mailman/listinfo/python-list