2 "Recode using XML char references"
5 from getopt import getopt
6 from m_lib.defenc import default_encoding
9 to_charset = default_encoding
11 options, arguments = getopt(sys.argv[1:], 'f:t:')
12 for option, value in options:
19 for file in arguments:
23 sys.stdout.write(line.decode(from_charset, "replace").encode(to_charset, "xmlcharrefreplace"))
27 for line in sys.stdin:
28 sys.stdout.write(line.decode(from_charset, "replace").encode(to_charset, "xmlcharrefreplace"))