mercurial/encoding.py
branchstable
changeset 17235 3745ae495ce5
parent 16493 72c6240a4b7d
child 17236 9fb8312dbdbd
--- a/mercurial/encoding.py	Sun Jul 22 13:16:45 2012 +0200
+++ b/mercurial/encoding.py	Mon Jul 23 15:55:22 2012 -0600
@@ -168,8 +168,9 @@
 def lower(s):
     "best-effort encoding-aware case-folding of local string s"
     try:
-        return s.encode('ascii').lower()
-    except UnicodeError:
+        s.decode('ascii') # throw exception for non-ASCII character
+        return s.lower()
+    except UnicodeDecodeError:
         pass
     try:
         if isinstance(s, localstr):