]> git.phdru.name Git - m_lib.git/commitdiff
Move defenc.py to a separate namespace package
authorOleg Broytman <phd@phdru.name>
Sun, 16 Apr 2017 11:54:47 +0000 (14:54 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 16 Apr 2017 11:54:47 +0000 (14:54 +0300)
m_lib/defenc.py [deleted file]

diff --git a/m_lib/defenc.py b/m_lib/defenc.py
deleted file mode 100755 (executable)
index 776b78d..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#! /usr/bin/env python
-"""Get default encoding"""
-
-from __future__ import print_function
-import sys
-
-try:
-   import locale
-   use_locale = True
-except ImportError:
-   use_locale = False
-
-__all__ = ['default_encoding']
-
-if use_locale:
-   # Get the default charset.
-   try:
-      lcAll = locale.getdefaultlocale()
-   except locale.Error as err:
-      print("WARNING:", err, file=sys.stderr)
-      lcAll = []
-
-   if len(lcAll) == 2 and lcAll[0] is not None:
-      default_encoding = lcAll[1]
-   else:
-      try:
-         default_encoding = locale.getpreferredencoding()
-      except locale.Error as err:
-         print("WARNING:", err, file=sys.stderr)
-         default_encoding = sys.getdefaultencoding()
-else:
-   default_encoding = sys.getdefaultencoding()
-
-default_encoding = default_encoding.lower()
-
-if __name__ == "__main__":
-   print(default_encoding)