changeset 9593:c358f3e78935

merge with crew-stable
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Sat, 10 Oct 2009 12:24:09 +0200
parents 5ebeef7cc201 (current diff) 5e44d9e562bc (diff)
children f0c5c59d878d
files
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/encoding.py	Sat Oct 10 12:23:42 2009 +0200
+++ b/mercurial/encoding.py	Sat Oct 10 12:24:09 2009 +0200
@@ -16,7 +16,9 @@
         # 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'