Skip to content

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

Closed

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

Activity

  1. changed the title [-]Inconsistent casing percent escaping in url-encoding[/-] [+]Inconsistent casing for percent-escapes in url-encoding[/+] on Jun 20, 2025
  2. bagder commented on Jun 21, 2025

    @bagder
    Member

    RFC 3986 section 2.1 says

    For consistency, URI producers and normalizers should use uppercase hexadecimal digits for all percent- encodings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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