regular expressions, unicode and XML

Justin Ezequiel justin.mailinglists at gmail.com
Thu Jan 26 02:19:54 EST 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