mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 15:19:42 +00:00
AK: Fix urlencode() with high byte values
Previously urlencode() would encode bytes above 127 incorrectly, printing them as negative hex values.
This commit is contained in:
parent
9d442ba606
commit
13f13a9e59
Notes:
sideshowbarker
2024-07-19 00:54:14 +09:00
Author: https://github.com/deoxxa
Commit: 13f13a9e59
Pull-request: https://github.com/SerenityOS/serenity/pull/4399
1 changed files with 1 additions and 1 deletions
|
@ -93,7 +93,7 @@ static inline bool in_userinfo_set(u32 c)
|
||||||
String urlencode(const StringView& input)
|
String urlencode(const StringView& input)
|
||||||
{
|
{
|
||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
for (char ch : input) {
|
for (unsigned char ch : input) {
|
||||||
if (in_userinfo_set((u8)ch)) {
|
if (in_userinfo_set((u8)ch)) {
|
||||||
builder.append('%');
|
builder.append('%');
|
||||||
builder.appendff("{:02X}", ch);
|
builder.appendff("{:02X}", ch);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue