mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
encoding: handle non-BMP characters in fromutf8b
This commit is contained in:
parent
001845ef91
commit
cc7a93dfa3
@ -504,7 +504,7 @@ def fromutf8b(s):
|
||||
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")
|
||||
|
Loading…
Reference in New Issue
Block a user