]> git.phdru.name Git - dotfiles.git/blobdiff - bin/iconvxml.py
Feat(recode-filenames-recursive): Allow to omit parameters
[dotfiles.git] / bin / iconvxml.py
diff --git a/bin/iconvxml.py b/bin/iconvxml.py
deleted file mode 100755 (executable)
index 86eb66d..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#! /usr/bin/env python
-"Recode using XML char references"
-
-import sys
-from getopt import getopt
-from m_lib.defenc import default_encoding
-
-from_charset = "utf-8"
-to_charset = default_encoding
-
-options, arguments = getopt(sys.argv[1:], 'f:t:')
-for option, value in options:
-   if option == '-f':
-      from_charset = value
-   elif option == '-t':
-      to_charset = value
-
-if arguments:
-   for file in arguments:
-      infile = open(file)
-      try:
-         for line in infile:
-            sys.stdout.write(unicode(line, 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"))