servo / servo/rust-url

Feature request: Provide customary RFC 3986 encoding

Open
#863 0 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.6k
Forks
406
PR merge metrics
No merged PRs in 30d

Description

  • Note that this crate implements the URL Standard not RFC 1738 or RFC 3986

Note taken, but why? RFC 3986 (or even wider open) is the standard everybody follows for URLs. While Chrome and FF are represented in that WG, they do not follow this nonsense in their encodeURIComponent().

And it makes a huge difference for human readability! It would cost you nothing to add one with these 4 harmless characters:

const RESERVED/*_RFC_3986*/: &AsciiSet = &NON_ALPHANUMERIC
    .remove(b'-')
    .remove(b'.')
    .remove(b'_')
    .remove(b'~');

Or the other way round, adding to CONTROLS, and then NON_ALPHANUMERIC to this one.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the encoding constants, including NON_ALPHANUMERIC and CONTROLS, and trace where the crate applies them. Compare that behavior with the requested RFC 3986 character set. Done means providing the requested customary RFC 3986 encoding behavior without changing the existing URL Standard behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.