Skip to content

Truly independent web browser

LibTextCodec: VERIFY that isomorphic_encode() input is isomorphic

Shannon Booth89ce8a8e3c4f
diff --git a/Libraries/LibTextCodec/Encoder.cpp b/Libraries/LibTextCodec/Encoder.cpp
index 1c8b5b34d00..0e7dc6cf501 100644
--- a/Libraries/LibTextCodec/Encoder.cpp
+++ b/Libraries/LibTextCodec/Encoder.cpp
@@ -229,10 +229,7 @@ ByteString isomorphic_encode(StringView input)
StringBuilder builder(input.length());
for (auto code_point : Utf8View { input }) {
- // VERIFY(code_point <= 0xFF);
- if (code_point > 0xFF)
- dbgln("FIXME: Trying to isomorphic encode a string with code points > U+00FF.");
-
+ VERIFY(code_point <= 0xFF);
builder.append(static_cast<u8>(code_point));
}
@@ -248,10 +245,7 @@ ByteString isomorphic_encode(Utf16View input)
StringBuilder builder(input.length_in_code_units());
for (auto code_point : input) {
- // VERIFY(code_point <= 0xFF);
- if (code_point > 0xFF)
- dbgln("FIXME: Trying to isomorphic encode a string with code points > U+00FF.");
-
+ VERIFY(code_point <= 0xFF);
builder.append(static_cast<u8>(code_point));
}