# HG changeset patch # User Matt Mackall # Date 1337635969 18000 # Node ID 133a7922a9006ec1f87c34b357957d2945452f3e # Parent 0a730d3c5aaefae00239b8472703c884192f31b7 win32: fix encoding handling for registry strings (issue3467) This stopped handling non-ASCII strings in 1.8 diff -r 0a730d3c5aae -r 133a7922a900 mercurial/win32.py --- a/mercurial/win32.py Wed May 16 17:02:30 2012 +0900 +++ b/mercurial/win32.py Mon May 21 16:32:49 2012 -0500 @@ -5,7 +5,6 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. -import encoding import ctypes, errno, os, struct, subprocess, random _kernel32 = ctypes.windll.kernel32 @@ -290,8 +289,8 @@ if res != _ERROR_SUCCESS: continue if type.value == _REG_SZ: - # never let a Unicode string escape into the wild - return encoding.tolocal(buf.value.encode('UTF-8')) + # string is in ANSI code page, aka local encoding + return buf.value elif type.value == _REG_DWORD: fmt = '