mercurial/util.py
changeset 3835 d1ce5461beed
parent 3816 fc5ba0ab7f45
child 3843 abaa2cd00d2b
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -19,6 +19,7 @@ demandload(globals(), "os threading time
 
 _encoding = os.environ.get("HGENCODING") or locale.getpreferredencoding()
 _encodingmode = os.environ.get("HGENCODINGMODE", "strict")
+_fallbackencoding = 'ISO-8859-1'
 
 def tolocal(s):
     """
@@ -30,7 +31,7 @@ def tolocal(s):
     using UTF-8, then Latin-1, and failing that, we use UTF-8 and
     replace unknown characters.
     """
-    for e in "utf-8 latin1".split():
+    for e in ('UTF-8', _fallbackencoding):
         try:
             u = s.decode(e) # attempt strict decoding
             return u.encode(_encoding, "replace")