This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20182 - Adding a "percent decode to bytes" algorithm
Summary: Adding a "percent decode to bytes" algorithm
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: URL (show other bugs)
Version: unspecified
Hardware: PC Windows 3.1
: P2 normal
Target Milestone: Unsorted
Assignee: Anne
QA Contact: sideshowbarker+urlspec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-30 16:19 UTC by Simon Sapin
Modified: 2012-12-21 14:58 UTC (History)
1 user (show)

See Also:


Attachments

Description Simon Sapin 2012-11-30 16:19:23 UTC
The URL standard has a "percent decode" algorithm: http://url.spec.whatwg.org/#percent-encoded-bytes

Parsing data: URLs probably requires a "percent decode to bytes" algorithm that is the same as "percent decode" with the following changes:

* Remove the first step
* Replace the last step by "Return bytes."

To avoid redundancy, "percent decode" can then be be re-defined as:

1. If ''encoding override'' is not given, set it to utf-8. [This step is unchanged]
2. Let ''bytes'' be the result of running ''percent decode to bytes'' on ''input''.
3. Return the result of running encoding override's decoder on bytes. [This step is unchanged]
Comment 1 Simon Sapin 2012-11-30 16:42:47 UTC
The "percent decode to bytes" name is only a suggestion. Better ideas for names are welcome :)

After this is added, data: parsing should be updated:
http://wiki.whatwg.org/wiki/URL_schemes#data:_URLs
Comment 2 Anne 2012-12-21 14:33:11 UTC
Simon, I updated the URL Standard the other day to do this, but I cannot update the wiki anymore as the draft moved elsewhere.
Comment 3 Simon Sapin 2012-12-21 14:58:10 UTC
Great, thanks.
http://simonsapin.github.com/data-urls/ is updated.