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 <[email protected]> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
_______________________________________________
Mailman-Developers mailing list
[email protected]
http://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives:
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe:
http://mail.python.org/mailman/options/mailman-developers/archive%40jab.org
Security Policy: http://wiki.list.org/x/QIA9