improve unicode handling (#3648)

This commit is contained in:
Alex Lam S.L
2019-12-28 18:06:51 +00:00
committed by GitHub
parent 4cf612dc9f
commit 22b47cdd63
3 changed files with 91 additions and 11 deletions

View File

@@ -133,14 +133,10 @@ function is_letter(code) {
}
function is_surrogate_pair_head(code) {
if (typeof code == "string")
code = code.charCodeAt(0);
return code >= 0xd800 && code <= 0xdbff;
}
function is_surrogate_pair_tail(code) {
if (typeof code == "string")
code = code.charCodeAt(0);
return code >= 0xdc00 && code <= 0xdfff;
}