about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2021-09-01 17:53:15 +0200
committertoonn <toonn@toonn.io>2021-09-01 17:57:15 +0200
commitdac6f0857c61afced54435cac23971c60ce77fd5 (patch)
tree8fc328e254d732b7f2c1a7e03a7333441cc5b9db
parent3f6a09f233cf12727be7405a52461dad3964dcf2 (diff)
downloadranger-dac6f0857c61afced54435cac23971c60ce77fd5.tar.gz
tags: Force UTF-8 encoding
-rw-r--r--ranger/container/tags.py6
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)