--- a/mercurial/encoding.py Thu Nov 05 17:09:00 2015 -0600+++ b/mercurial/encoding.py Thu Nov 05 17:11:50 2015 -0600@@ -504,7 +504,7 @@ u = s.decode("utf-8") r = "" for c in u:- if ord(c) & 0xff00 == 0xdc00:+ if ord(c) & 0xffff00 == 0xdc00: r += chr(ord(c) & 0xff) else: r += c.encode("utf-8")