Skip to content

Inconsistent casing for percent-escapes in url-encoding #17685

@jeroen

Description

@jeroen

The examples below are from my bindings, if needed I can translate them to C later.

I did this

When using curl_easy_escape() characters get escaped with uppercase percentage codes:

curl_easy_escape("foo;bar")
# foo%3Bbar

But when using the URL parser with CURLU_URLENCODE and setting e.g. CURLUPART_PATH then we get a lowercase:

curl:::curl_modify_url('https://test', path = 'foo;bar')
# "https://test/foo%3bbar

Is this intentional? The ambiguity is technically not incorrect but makes it more difficult to write tests.

I expected the following

Consistent upper or lowercase when url-encoding.

curl/libcurl version

8.14.1

operating system

MacOS 15

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions