about summary refs log tree commit diff stats
path: root/ranger
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
commit9bd3ccdda523168589d7ee4d5c1a9d4610371791 (patch)
treedf76421319f17590e55e0099fbc6881f4674cc90 /ranger
parentcec7bd50aa61eabd1cd8b1da2f2c2115e7b23662 (diff)
downloadranger-9bd3ccdda523168589d7ee4d5c1a9d4610371791.tar.gz
metadata: Force UTF-8 encoding
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/metadata.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ranger/core/metadata.py b/ranger/core/metadata.py
index 2c5165da..534c083c 100644
--- a/ranger/core/metadata.py
+++ b/ranger/core/metadata.py
@@ -86,7 +86,7 @@ class MetadataManager(object):
         self.metadata_cache[filename] = entry
         self.metafile_cache[metafile] = entries
 
-        with open(metafile, "w") as fobj:
+        with open(metafile, "w", encoding="utf-8") as fobj:
             json.dump(entries, fobj, check_circular=True, indent=2)
 
     def _get_entry(self, filename):
@@ -119,7 +119,7 @@ class MetadataManager(object):
             return self.metafile_cache[metafile]
 
         if exists(metafile):
-            with open(metafile, "r") as fobj:
+            with open(metafile, "r", encoding="utf-8") as fobj:
                 try:
                     entries = json.load(fobj)
                 except ValueError: