Fil wrote:
OK I get something working with the following:
def escape(self, value): try: b = unicode(value,'utf-8') except: try: b = unicode(value,'latin-1') except: b = value return unicode(MySQLdb.escape_string(b.encode('utf-8')),'utf-8')
will try a little more and commit if it works
I'm not totally up on what you're doing here, but I assume that value is something like the member's real name.
In this case I think you may want something like
From Mailman import Utils ... def escape(self, value): lcset = Utils.GetCharSet(mlist.preferred_language) b = unicode(value, lcset) ...
I.e. text items relating to a list or a member are normally either unicodes to begin with or they are encoded in the character set of the list's preferred language.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan