mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
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:
parent
86b1c78c1a
commit
9fc3e72db2
Notes:
github-actions[bot]
2025-07-03 13:53:17 +00:00
Author: https://github.com/trflynn89
Commit: 9fc3e72db2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5228
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/shannonbooth
14 changed files with 74 additions and 77 deletions
|
@ -181,7 +181,7 @@ public:
|
|||
{
|
||||
return m_view.visit(
|
||||
[](StringView view) { return view.to_byte_string(); },
|
||||
[](Utf16View view) { return view.to_byte_string(Utf16View::AllowInvalidCodeUnits::Yes).release_value_but_fixme_should_propagate_errors(); },
|
||||
[](Utf16View view) { return view.to_byte_string().release_value_but_fixme_should_propagate_errors(); },
|
||||
[](auto& view) {
|
||||
StringBuilder builder;
|
||||
for (auto it = view.begin(); it != view.end(); ++it)
|
||||
|
@ -194,7 +194,7 @@ public:
|
|||
{
|
||||
return m_view.visit(
|
||||
[](StringView view) { return String::from_utf8(view); },
|
||||
[](Utf16View view) { return view.to_utf8(Utf16View::AllowInvalidCodeUnits::Yes); },
|
||||
[](Utf16View view) { return view.to_utf8(); },
|
||||
[](auto& view) -> ErrorOr<String> {
|
||||
StringBuilder builder;
|
||||
for (auto it = view.begin(); it != view.end(); ++it)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue