diff mercurial/windows.py @ 31456:067add650129

encoding: factor out unicode variants of from/tolocal() Unfortunately, these functions will be commonly used on Python 3.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 13 Mar 2017 09:11:08 -0700
parents f1c9fafcbf46
children 52361c4f4dac
line wrap: on
line diff
--- a/mercurial/windows.py	Mon Mar 13 08:53:31 2017 -0700
+++ b/mercurial/windows.py	Mon Mar 13 09:11:08 2017 -0700
@@ -442,7 +442,7 @@
         try:
             val = winreg.QueryValueEx(winreg.OpenKey(s, key), valname)[0]
             # never let a Unicode string escape into the wild
-            return encoding.tolocal(val.encode('UTF-8'))
+            return encoding.unitolocal(val)
         except EnvironmentError:
             pass