This AK::Format
format system does not handle Unicode properly. An example (the same happens without a padding character):
outln("{:x>4s}", "a"); // outputs "xxxa"
outln("{:x>4s}", "©"); // outputs "xx©"
This is because the © (U+00A9) uses two bytes when encoded as UTF-8. Thus, the length measurement in FormatBuilder::put_string
thinks the String has length two, and thus only prints two padding characters.
Lines 189 to 197 in ecaae2d
The immediate fix would be using Utf8View
if the StringView
is valid UTF-8, but I don't know if this has some other implications or if we should use a more general solution.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too