diff options
-rw-r--r-- | ranger/container/tags.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ranger/container/tags.py b/ranger/container/tags.py index 1a751ffc..4d4e6c59 100644 --- a/ranger/container/tags.py +++ b/ranger/container/tags.py @@ -75,7 +75,9 @@ class Tags(FileManagerAware): def sync(self): try: - with open(self._filename, "r", errors="replace") as fobj: + with open( + self._filename, "r", encoding="utf-8", errors="replace" + ) as fobj: self.tags = self._parse(fobj) except (OSError, IOError) as err: if exists(self._filename): @@ -85,7 +87,7 @@ class Tags(FileManagerAware): def dump(self): try: - with open(self._filename, 'w') as fobj: + with open(self._filename, 'w', encoding="utf-8") as fobj: self._compile(fobj) except OSError as err: self.fm.notify(err, bad=True) |