encoding: handle non-BMP characters in fromutf8b
authorMatt Mackall <mpm@selenic.com>
Thu, 05 Nov 2015 17:11:50 -0600
changeset 26877 cb467a9d7593
parent 26876 b8381832ce2b
child 26878 d7e83f106459
encoding: handle non-BMP characters in fromutf8b
mercurial/encoding.py
--- 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")