X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=bin%2Ficonv.py;h=83de413dc373ac5093e3cedfd971870676dbe6d9;hb=9a66d4531e7d0d015b38be0b38f1c379a45fd03f;hp=41631fea5bd449cd6128f4a33adbe5835c8bb8ac;hpb=f46bd4d41cc7f243bc8a321effee5200aa69e709;p=dotfiles.git diff --git a/bin/iconv.py b/bin/iconv.py index 41631fe..83de413 100755 --- a/bin/iconv.py +++ b/bin/iconv.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, "replace")) + sys.stdout.write(line.decode(from_charset, "replace").encode(to_charset, "replace")) except: infile.close() else: for line in sys.stdin: - sys.stdout.write(unicode(line, from_charset, "replace").encode(to_charset, "replace")) + sys.stdout.write(line.decode(from_charset, "replace").encode(to_charset, "replace"))