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:
parent
7e4793df63
commit
b006a60366
Notes:
sideshowbarker
2024-07-17 16:35:49 +09:00
Author: https://github.com/krkk
Commit: b006a60366
Pull-request: https://github.com/SerenityOS/serenity/pull/13302
Reviewed-by: https://github.com/IdanHo
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue