diff options
author | toonn <toonn@toonn.io> | 2019-09-30 15:46:45 +0200 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2019-09-30 15:46:45 +0200 |
commit | 6ffe1183daa665e3790ad456119f7705263af3da (patch) | |
tree | c85bd791c24b4b91f3e76fcb263472ee2a59227c | |
parent | a0e9432c4b8718fd96c25fd6f791cd477aea65cd (diff) | |
download | ranger-6ffe1183daa665e3790ad456119f7705263af3da.tar.gz |
Switch from surrogatepass to surrogateescape
Vim (and presumably other editors) can't render the mixed utf-8 with utf-16 surrogates text properly.
-rwxr-xr-x | ranger/config/commands.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 3496e28c..d1e4bdbc 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1078,11 +1078,11 @@ class bulkrename(Command): listpath = listfile.name if py3: listfile.write("\n".join(filenames).encode( - encoding="utf-8", errors="surrogatepass")) + encoding="utf-8", errors="surrogateescape")) else: listfile.write("\n".join(filenames)) self.fm.execute_file([File(listpath)], app='editor') - with (open(listpath, 'r', encoding="utf-8", errors="surrogatepass") if + with (open(listpath, 'r', encoding="utf-8", errors="surrogateescape") if py3 else open(listpath, 'r')) as listfile: new_filenames = listfile.readlines() os.unlink(listpath) @@ -1112,7 +1112,7 @@ class bulkrename(Command): script_content = "\n".join(script_lines) + "\n" if py3: cmdfile.write(script_content.encode(encoding="utf-8", - errors="surrogatepass")) + errors="surrogateescape")) else: cmdfile.write(script_content) cmdfile.flush() |