AK: Allow treating UTF-16 views with lonely surrogates as valid

Much of the web requires us to allow lonely surrogates in UTF-16 data.
The default behavior to disallow such code units has not been changed
here - that will be changed in an upcoming commit.
This commit is contained in:
Timothy Flynn 2025-06-18 11:04:18 -04:00 committed by Tim Flynn
commit 2abc955ca9
Notes: github-actions[bot] 2025-07-03 13:53:41 +00:00
3 changed files with 84 additions and 38 deletions

View file

@ -148,8 +148,8 @@ public:
bool starts_with(Utf16View const&) const;
bool is_code_unit_less_than(Utf16View const& other) const;
bool validate() const;
bool validate(size_t& valid_code_units) const;
bool validate(AllowInvalidCodeUnits = AllowInvalidCodeUnits::No) const;
bool validate(size_t& valid_code_units, AllowInvalidCodeUnits = AllowInvalidCodeUnits::No) const;
bool equals_ignoring_case(Utf16View const&) const;