Make improvements

This commit is contained in:
Justine Tunney
2020-12-01 03:43:40 -08:00
parent 3e4fd4b0ad
commit e44a0cf6f8
256 changed files with 23100 additions and 2294 deletions

View File

@@ -22,11 +22,17 @@
wint_t DecodeNtsUtf16(const char16_t **s) {
wint_t x, y;
if (!IsUcs2((x = *(*s)++))) {
if ((y = *(*s)++)) {
x = MergeUtf16(x, y);
for (;;) {
if (!(x = *(*s)++)) break;
if (IsUtf16Cont(x)) continue;
if (IsUcs2(x)) {
return x;
} else {
x = 0;
if ((y = *(*s)++)) {
return MergeUtf16(x, y);
} else {
return 0;
}
}
}
return x;