1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09: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
Notes: sideshowbarker 2024-07-17 16:35:49 +09:00

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);
}
}