From b006a60366c513528d0f7fe818be2558150e9b11 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Sun, 27 Mar 2022 08:48:25 +0200 Subject: [PATCH] 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. --- Userland/Libraries/LibTextCodec/Decoder.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibTextCodec/Decoder.cpp b/Userland/Libraries/LibTextCodec/Decoder.cpp index 71795a265e..57695ec847 100644 --- a/Userland/Libraries/LibTextCodec/Decoder.cpp +++ b/Userland/Libraries/LibTextCodec/Decoder.cpp @@ -7,6 +7,7 @@ #include #include +#include #include namespace TextCodec { @@ -215,7 +216,7 @@ String Decoder::to_utf8(StringView input) void UTF8Decoder::process(StringView input, Function on_code_point) { - for (auto c : input) { + for (auto c : Utf8View(input)) { on_code_point(c); } }