changeset 26877:cb467a9d7593

encoding: handle non-BMP characters in fromutf8b
author Matt Mackall <mpm@selenic.com>
date Thu, 05 Nov 2015 17:11:50 -0600
parents b8381832ce2b
children d7e83f106459
files mercurial/encoding.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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")