[Mailman-Developers] "Orignal" MySQL Member Adaptor - 1.71

Fil fil at rezo.net
Wed Jan 7 18:29:55 CET 2009


I was able to go a bit further with the script below. Unfortunately
when that utf-8-encoded mysql-escaped string goes back up into MySQLdb
I get hit by another encoding error inside MySQLdb. So my best for the
moment is to stay with my current implementation which escapes all
strings to html decimal entities.



#!/usr/bin/python

import os, sys
import MySQLdb
from types import StringType,UnicodeType

a='\'And"ré'

try:
  b=unicode(a,'utf-8')
except:
  b=unicode(a,'latin-1')

print b.encode('latin-1')
print b.encode('utf-8')

print MySQLdb.escape_string(b.encode('utf-8'))



-- Fil


More information about the Mailman-Developers mailing list