X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=blobdiff_plain;f=bin%2Ficonvxml.py;fp=bin%2Ficonvxml.py;h=2892a919d70195bcebb0f62ad55277f915f844a3;hp=86eb66dbad906fc388f6c85ccc92d5dd8a446b2c;hb=f0344023aa21ede3b47d77559af54b97c37f328b;hpb=c5883d2a782366c0a3468a989e756cf37dabbd46 diff --git a/bin/iconvxml.py b/bin/iconvxml.py index 86eb66d..2892a91 100755 --- a/bin/iconvxml.py +++ b/bin/iconvxml.py @@ -20,9 +20,9 @@ if arguments: infile = open(file) try: for line in infile: - sys.stdout.write(unicode(line, from_charset, "replace").encode(to_charset, "xmlcharrefreplace")) + sys.stdout.write(line.decode(from_charset, "replace").encode(to_charset, "xmlcharrefreplace")) except: infile.close() else: for line in sys.stdin: - sys.stdout.write(unicode(line, from_charset, "replace").encode(to_charset, "xmlcharrefreplace")) + sys.stdout.write(line.decode(from_charset, "replace").encode(to_charset, "xmlcharrefreplace"))