[Mailman-Developers] Transformation of non-ascii characters - was: bounce problem w/ 2.1.11rc1 and GMail

Fil fil at rezo.net
Mon Jun 16 09:21:32 CEST 2008


> There may be an issue with your MemberAdaptor. With
> OldStyleMemberships.py, accented characters are accepted and stored as
> themselves in the usernames dictionary.

Yes you are correct Mark, this escaping is done by MysqlMemberships.py

    def escape(self, value):
        # transforms accents into html entities (é)
        # TODO: find out which language is current (here: uses iso-8859-1)
        value = Utils.uncanonstr(value)
        # addslashes before " and '
        return MySQLdb.escape_string(value)

the difficulty is that MySQLdb.escape_string crashes if given non-ascii text.

So I'm modifying MysqlMemberships.py (rev. 94) so that we canonstr()
back in getMemberName().
However it's a not ideal; I don't like that idea very much as it means
that inside the db it is stored as è. Should probably be utf-8.

-- Fil


More information about the Mailman-Developers mailing list