Skip to content

Conversation

@ChALkeR
Copy link
Collaborator

@ChALkeR ChALkeR commented Jan 23, 2026

cc @domenic

Ref: https://url.spec.whatwg.org/#string-percent-encode-after-encoding

Api

  1. C0 control percent-encode set is always percent-encoded (below U+0020, U+007F, above U+007F).

  2. Other chars to encode are specified as a literal string percentEncodeSet, containing unique increasing codepoints in range 0x20 - 0x7e. No sets except C0 are hardcoded.

  3. I made this non-fatal, unlike encodeURIComponent it now normalizes the input to a well-formed string. I can revert that and throw on non-scalarvalue strings instead.

    The only thing that's not acceptable there is trusting the input to be scalarvalue and returning e.g. � on \d800

    In the actual usage all input to the spec-defined method is expected to be scalarvalue.

@ChALkeR ChALkeR force-pushed the chalker/percentEncodeAfterEncoding/0 branch from 6ab73f8 to 9b8fd67 Compare January 23, 2026 20:35
@ChALkeR ChALkeR force-pushed the chalker/percentEncodeAfterEncoding/0 branch 7 times, most recently from 56052c5 to eacc182 Compare January 23, 2026 21:57
@ChALkeR
Copy link
Collaborator Author

ChALkeR commented Jan 24, 2026

@domenic I think the spec is wrong
Upd: whatwg/url#895
Upd: fix in whatwg/url#896

@ChALkeR ChALkeR force-pushed the chalker/percentEncodeAfterEncoding/0 branch 15 times, most recently from 11c6dfc to 3628d3a Compare January 24, 2026 12:44
@ChALkeR ChALkeR requested a review from Copilot January 24, 2026 19:46

This comment was marked as outdated.

@ChALkeR ChALkeR force-pushed the chalker/percentEncodeAfterEncoding/0 branch from 3628d3a to f8e5f94 Compare January 24, 2026 19:58
@ChALkeR ChALkeR requested a review from Copilot January 24, 2026 19:59

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

@ChALkeR
Copy link
Collaborator Author

ChALkeR commented Feb 1, 2026

I'm planning to add more cross-tests with browsers and merge this soon.

@ChALkeR ChALkeR force-pushed the chalker/percentEncodeAfterEncoding/0 branch from 9b7f280 to 931a8b1 Compare February 1, 2026 19:37
@ChALkeR ChALkeR requested a review from Copilot February 1, 2026 21:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ChALkeR ChALkeR force-pushed the chalker/percentEncodeAfterEncoding/0 branch 5 times, most recently from c5ce31c to 462c3da Compare February 1, 2026 22:19
@ChALkeR ChALkeR force-pushed the chalker/percentEncodeAfterEncoding/0 branch from 462c3da to 439fee1 Compare February 1, 2026 22:35
@ChALkeR ChALkeR merged commit 2bcc065 into main Feb 1, 2026
30 checks passed
@ChALkeR ChALkeR deleted the chalker/percentEncodeAfterEncoding/0 branch February 1, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants