regular expressions, unicode and XML

Justin Ezequiel justin.mailinglists at gmail.com
Thu Jan 26 08:19:54 CET 2006


import codecs

f = codecs.open(pth, 'r', 'utf-8')
data = f.read()
f.close()

## data = re.sub ...

f = codecs.open(pth, 'w', 'utf-8')
f.write(data)
f.close()




More information about the Python-list mailing list