# HG changeset patch # User Augie Fackler # Date 2017-09-15 23:43:32 # Node ID 112f118ecb00c9ba265ecceac22c17a0d23b537b # Parent 90b0e1639fd48059b5583cc322ce827c42230bb0 encoding: ensure getutf8char always returns a bytestr, never an int diff --git a/mercurial/encoding.py b/mercurial/encoding.py --- a/mercurial/encoding.py +++ b/mercurial/encoding.py @@ -458,9 +458,9 @@ def getutf8char(s, pos): ''' # 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