LearningTransformsv1

Encode and decode URL components

Turn unsafe URL characters into percent-encoded bytes and decode them again.

Reddit
Output
Transformed result
query%3Dresults%20library%26page%3D1
Programming example
Input
Relationship

What connects the input and output?

Percent encoding represents a UTF-8 byte as a percent sign followed by two hexadecimal digits. Reserved URL delimiters are encoded when they belong to a component value.

Sources

2
  1. WHATWG URL Standard: Percent-encoded bytesWHATWG
  2. MDN: encodeURIComponent()Mozilla Developer Network

Discussion

0

Sign in to join the discussion.