AK+Everywhere: Allow lonely UTF-16 surrogates by default

By definition, the web allows lonely surrogates by default. Let's have
our string APIs reflect this, so we don't have to pass an allow option
all over the place.
This commit is contained in:
Timothy Flynn 2025-06-26 19:52:09 -04:00 committed by Tim Flynn
commit 9fc3e72db2
Notes: github-actions[bot] 2025-07-03 13:53:17 +00:00
14 changed files with 74 additions and 77 deletions

View file

@ -93,7 +93,7 @@ static ParseResult<ByteString> parse_name(Stream& stream)
ScopeLogger<WASM_BINPARSER_DEBUG> logger;
auto data = TRY(parse_vector<u8>(stream));
auto string = ByteString::copy(data);
if (!Utf8View(string).validate(Utf8View::AllowSurrogates::No))
if (!Utf8View(string).validate(AllowLonelySurrogates::No))
return ParseError::InvalidUtf8;
return string;
}