summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gay <eapoems@riseup.net>2024-01-28 22:17:27 -0500
committerDavid Gay <eapoems@riseup.net>2024-01-28 22:17:27 -0500
commit50a99d5991c0f2fe0f718bf49b7418a193f892c9 (patch)
tree730750eec4c6e9dd665919de2b3c78d0df1a051b
parent74d577506b4794619e60f0b6f8309805447df980 (diff)
Don't try to automatically determine encoding, for now
-rw-r--r--subsync.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/subsync.py b/subsync.py
index 7740baa..23343a6 100644
--- a/subsync.py
+++ b/subsync.py
@@ -19,8 +19,9 @@ os.chdir(os.path.dirname(os.path.realpath(__file__)))
class mopen:
def __init__(self, filename, mode='r'):
- self.real_encoding = chardet.detect(open(filename, 'rb').read())['encoding'].lower()
- self.file_o = open(filename, mode, encoding=self.real_encoding)
+ # TODO: Attempt checking encoding, and only fall back to utf-8 if it fails.
+ # self.real_encoding = chardet.detect(open(filename, 'rb').read())['encoding'].lower()
+ self.file_o = open(filename, mode, encoding="utf-8")
def __getattr__(self, name):
return getattr(self.file_o, name)