branch | stable |
changeset 17236 | 9fb8312dbdbd |
parent 17235 | 3745ae495ce5 |
child 17424 | e7cfe3587ea4 |
--- a/mercurial/encoding.py Mon Jul 23 15:55:22 2012 -0600 +++ b/mercurial/encoding.py Mon Jul 23 15:55:26 2012 -0600 @@ -190,6 +190,11 @@ def upper(s): "best-effort encoding-aware case-folding of local string s" try: + s.decode('ascii') # throw exception for non-ASCII character + return s.upper() + except UnicodeDecodeError: + pass + try: if isinstance(s, localstr): u = s._utf8.decode("utf-8") else: