# HG changeset patch # User Dirkjan Ochtman # Date 2009-10-10 10:24:09 # Node ID c358f3e7893551fe08b90e5e5e001db6cac1213f # Parent 5ebeef7cc2010790cc538640f65299e52838b431 # Parent 5e44d9e562bc120c32011edd6c830be5d3e6a696 merge with crew-stable diff --git a/mercurial/encoding.py b/mercurial/encoding.py --- a/mercurial/encoding.py +++ b/mercurial/encoding.py @@ -16,7 +16,9 @@ try: # On darwin, getpreferredencoding ignores the locale environment and # always returns mac-roman. We override this if the environment is # not C (has been customized by the user). - locale.setlocale(locale.LC_CTYPE, '') + lc = locale.setlocale(locale.LC_CTYPE, '') + if lc == 'UTF-8': + locale.setlocale(locale.LC_CTYPE, 'en_US.UTF-8') encoding = locale.getlocale()[1] if not encoding: encoding = locale.getpreferredencoding() or 'ascii'