about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2021-09-01 17:53:16 +0200
committertoonn <toonn@toonn.io>2021-09-01 17:57:15 +0200
commit896475350744d45f25de69c80e690fcddfad8dc2 (patch)
tree45879d92f459bc70be75f68e06b423f3c9858ef7
parentaa434db91977960b29bc10c8aa58c038d02fa6b8 (diff)
downloadranger-896475350744d45f25de69c80e690fcddfad8dc2.tar.gz
console: Force UTF-8 encoding
-rw-r--r--ranger/gui/widgets/console.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py
index 29c13e22..f6d3461f 100644
--- a/ranger/gui/widgets/console.py
+++ b/ranger/gui/widgets/console.py
@@ -45,7 +45,7 @@ class Console(Widget):  # pylint: disable=too-many-instance-attributes,too-many-
             self.historypath = self.fm.datapath('history')
             if os.path.exists(self.historypath):
                 try:
-                    with open(self.historypath, "r") as fobj:
+                    with open(self.historypath, "r", encoding="utf-8") as fobj:
                         try:
                             for line in fobj:
                                 self.history.add(line[:-1])
@@ -80,7 +80,7 @@ class Console(Widget):  # pylint: disable=too-many-instance-attributes,too-many-
             return
         if self.historypath:
             try:
-                with open(self.historypath, 'w') as fobj:
+                with open(self.historypath, 'w', encoding="utf-8") as fobj:
                     for entry in self.history_backup:
                         try:
                             fobj.write(entry + '\n')