Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Express validity, error correction and percent encode sets in a single table #855

Open
alwinb opened this issue Feb 15, 2025 · 0 comments
Open

Comments

@alwinb
Copy link
Contributor

alwinb commented Feb 15, 2025

This is a proposal to include a table, either as clarification,
or (my current preference) even as a full replacement for describing:

  • Percent encode sets
  • Valid vs invalid individual code points per component, and
  • Error correction behaviour of the above,

Within a single small-ish table.

For each component of an URL that contains a percent encoded string,
we can describe per codepoint its validity, error correction and encoding.

A single code point is either:

  • v: Valid and included verbatim in the output URL.
  • E: (Escape) valid but nonetheless percent encoded.
  • T: (Tolerate) invalid, but nonetheless left untouched by the parser —resulting in an invalid URL as output.
  • F: (Fixed) invalid and fixed by the parser (and setters) by percent encoding the occurrence.
  • R: (Reject) Invalid and causing a hard error, so that they do not end up in output URLs.
Image

Notes:

  • 'Other control' here is control-c0 ∪ del-c1 ∪ surrogate ∪ non-char
  • The apostrophe in the query is special cased for 'non-special' URLs where it is left untouched (ie. v: Valid) hence the superscript. Special query could also be broken out into a separate column.

(If there have been changes to these sets in the last year or so, the table might be slightly out of date)


I would like to thank @LEW21 for the idea to chart things out in this way in #379

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

No branches or pull requests

1 participant