Don't get stuck on invalid UTF-16
Replaces invalid unicode with replacement character U+FFFD and always makes forward progress. Bug: 15849380 Change-Id: Ic59ef6c64b0f5c4450bcae61597adcc269d6e7c5
This commit is contained in:
committed by
Raph Levien
parent
ded72d1e4a
commit
abf2e7d050
@@ -397,11 +397,10 @@ static hb_codepoint_t decodeUtf16(const uint16_t* chars, size_t len, ssize_t* it
|
||||
const hb_codepoint_t delta = (0xd800 << 10) + 0xdc00 - 0x10000;
|
||||
return (((hb_codepoint_t)v) << 10) + v2 - delta;
|
||||
}
|
||||
(*iter) -= 2;
|
||||
return ~0u;
|
||||
(*iter) -= 1;
|
||||
return 0xFFFDu;
|
||||
} else {
|
||||
(*iter)--;
|
||||
return ~0u;
|
||||
return 0xFFFDu;
|
||||
}
|
||||
} else {
|
||||
return v;
|
||||
|
||||
Reference in New Issue
Block a user