Skip to content

Instantly share code, notes, and snippets.

@Kwpolska
Created February 18, 2014 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kwpolska/9067538 to your computer and use it in GitHub Desktop.
Save Kwpolska/9067538 to your computer and use it in GitHub Desktop.
import codecs
xmlfile = 'xml.xml'
with codecs.open('ancient', 'w', 'iso-8859-2') as finalxml:
with codecs.open(xmlfile, 'r', 'utf-8') as f:
for line in f:
result = robj.sub(lambda m: dict[m.group(0)], line)
result = '\t\t\t' + result
finalxml.write(result.encode('iso-8859-2'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment