Fix space handling in url_en/decode

This commit is contained in:
2026-06-17 17:34:07 +02:00
parent 12222e9a0f
commit c9f43c152d
2 changed files with 9 additions and 10 deletions

View File

@@ -51,8 +51,7 @@ void url_encode(Noh_String *string) {
for (size_t i = 0; i < string->count; i++) {
char cur = string->elems[i];
if (cur == ' ') noh_da_append(&result, '+');
if (!byte_is_url_safe(cur)) {
else if (!byte_is_url_safe(cur)) {
noh_da_append(&result, '%');
noh_da_append(&result, to_char_lower(cur >> 4));
noh_da_append(&result, to_char_lower(cur));