Skip to content

Conversation

@Worldwidebrine
Copy link
Contributor

Description

Added an example showing that normal text characters can also be percent-encoded, even if they don't have to.

Motivation

const hex = [];
hex.length = 256;
for (let i = 0; i < 256; i++) {
  hex[i] = i.toString(16).padStart(2, "0");
}
console.log(hex);
fetch(`data:application/octet-stream;,%${hex.join("%")}`)
  .then((resp) => resp.arrayBuffer())
  .then((buf) => {
    const bytes = new Uint8Array(buf);
    console.log([...bytes]);
    for (let i = 0; i < 256; i++) {
      if (bytes[i] !== i) {
        console.log(`buf[${i}] !== ${i}`);
      }
    }
    console.log("finished");
  });

Additional details

Related issues and pull requests

@Worldwidebrine Worldwidebrine requested a review from a team as a code owner November 14, 2025 00:28
@Worldwidebrine Worldwidebrine requested review from chrisdavidmills and removed request for a team November 14, 2025 00:28
@github-actions github-actions bot added Content:Other Any docs not covered by another "Content:" label size/xs [PR only] 0-5 LoC changed labels Nov 14, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 14, 2025

Preview URLs

Flaws (1)

URL: /en-US/docs/Web/URI/Reference/Schemes/data
Title: data: URLs
Flaw count: 1

  • macros:
    • Macro produces link /en-US/docs/Web/CSS/url_value which is a redirect

(comment last updated: 2025-11-14 08:39:57)

Worldwidebrine and others added 2 commits November 14, 2025 13:12
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

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

Thanks, @Worldwidebrine.

As you'll see from my comments below, I did find the addition a little confusing. If I've totally misunderstood this, maybe you can explain your motivation a bit more, to help me understand.

Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:Other Any docs not covered by another "Content:" label size/xs [PR only] 0-5 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants