mercurial/ui.py
changeset 31532 713e984bec91
parent 31490 8122cc5cb543
child 31535 d0f95ecca2ad
--- a/mercurial/ui.py	Sun Mar 19 01:12:03 2017 -0400
+++ b/mercurial/ui.py	Sun Mar 19 01:38:10 2017 -0400
@@ -1196,7 +1196,7 @@
                                       dir=rdir)
         try:
             f = os.fdopen(fd, pycompat.sysstr("w"))
-            f.write(text)
+            f.write(encoding.strfromlocal(text))
             f.close()
 
             environ = {'HGUSER': user}
@@ -1219,7 +1219,7 @@
                         blockedtag='editor')
 
             f = open(name)
-            t = f.read()
+            t = encoding.strtolocal(f.read())
             f.close()
         finally:
             os.unlink(name)