mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:07:46 +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:
parent
7e4793df63
commit
b006a60366
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