mercurial/encoding.py
changeset 33945 853574db5b12
parent 33944 f4433f2713d0
child 33946 6c119dbfd0c0
--- a/mercurial/encoding.py	Sun Apr 23 12:59:42 2017 +0900
+++ b/mercurial/encoding.py	Sun Apr 23 13:06:23 2017 +0900
@@ -128,6 +128,9 @@
     'foo: \\xc3\\xa4'
     """
 
+    if isasciistr(s):
+        return s
+
     try:
         try:
             # make sure string is actually stored in UTF-8
@@ -170,6 +173,8 @@
     # can we do a lossless round-trip?
     if isinstance(s, localstr):
         return s._utf8
+    if isasciistr(s):
+        return s
 
     try:
         u = s.decode(_sysstr(encoding), _sysstr(encodingmode))