mercurial/encoding.py
changeset 34207 112f118ecb00
parent 34152 a8994d08e4a2
child 34223 1c601df9894c
--- a/mercurial/encoding.py	Fri Sep 15 19:43:02 2017 -0400
+++ b/mercurial/encoding.py	Fri Sep 15 19:43:32 2017 -0400
@@ -458,9 +458,9 @@
     '''
 
     # find how many bytes to attempt decoding from first nibble
-    l = _utf8len[ord(s[pos]) >> 4]
+    l = _utf8len[ord(s[pos:pos + 1]) >> 4]
     if not l: # ascii
-        return s[pos]
+        return s[pos:pos + 1]
 
     c = s[pos:pos + l]
     # validate with attempted decode