1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:07:35 +00:00

LibTextCodec: Pass code points instead of bytes on UTF-8 string process

Previously we were passing raw UTF-8 bytes as code points, which caused
CSS content properties to display incorrect characters.

This makes bullet separators in Wikipedia templates display correctly.
This commit is contained in:
Karol Kosek 2022-03-27 08:48:25 +02:00 committed by Andreas Kling
parent 7e4793df63
commit b006a60366

View file

@ -7,6 +7,7 @@
#include <AK/String.h>
#include <AK/StringBuilder.h>
#include <AK/Utf8View.h>
#include <LibTextCodec/Decoder.h>
namespace TextCodec {
@ -215,7 +216,7 @@ String Decoder::to_utf8(StringView input)
void UTF8Decoder::process(StringView input, Function<void(u32)> on_code_point)
{
for (auto c : input) {
for (auto c : Utf8View(input)) {
on_code_point(c);
}
}