# HG changeset patch # User Matt Mackall # Date 1228244740 21600 # Node ID 2a67430f92f15ea5159c26b09ec4839a0c549a26 # Parent 3342e6ada4b9abe8115941f8078f0f2604a9210a encoding: normalize some silly encoding names diff -r 3342e6ada4b9 -r 2a67430f92f1 mercurial/util.py --- 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")