--- a/mercurial/util.py Tue Dec 02 19:36:43 2008 +0100
+++ b/mercurial/util.py Tue Dec 02 13:05:40 2008 -0600
@@ -81,6 +81,8 @@
popen3 = os.popen3
+_encodingfixup = {'646': 'ascii', 'ANSI_X3.4-1968': 'ascii'}
+
try:
_encoding = os.environ.get("HGENCODING")
if sys.platform == 'darwin' and not _encoding:
@@ -91,6 +93,7 @@
_encoding = locale.getlocale()[1]
if not _encoding:
_encoding = locale.getpreferredencoding() or 'ascii'
+ _encoding = _encodingfixup.get(_encoding, _encoding)
except locale.Error:
_encoding = 'ascii'
_encodingmode = os.environ.get("HGENCODINGMODE", "strict")