Skip to content

Info about Blob blobParts strings encoding#44324

Open
olfek wants to merge 1 commit into
mdn:mainfrom
olfek:patch-1
Open

Info about Blob blobParts strings encoding#44324
olfek wants to merge 1 commit into
mdn:mainfrom
olfek:patch-1

Conversation

@olfek
Copy link
Copy Markdown
Contributor

@olfek olfek commented Jun 1, 2026

No description provided.

@olfek olfek requested a review from a team as a code owner June 1, 2026 15:10
@olfek olfek requested review from pepelsbey and removed request for a team June 1, 2026 15:10
@github-actions github-actions Bot added Content:WebAPI Web API docs size/xs [PR only] 0-5 LoC changed labels Jun 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Preview URLs (1 page)

External URLs (1)

URL: /en-US/docs/Web/API/Blob/Blob
Title: Blob: Blob() constructor

Copy link
Copy Markdown
Member

@pepelsbey pepelsbey left a comment

Choose a reason for hiding this comment

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

Hey! Thank you for the PR.

Could you please clarify what issue this PR addresses?

It might look self-evident to you, but it would be good to understand intention. We don’t bring everything from the spec to MDN. Only the parts that are useful for web developers.

@olfek
Copy link
Copy Markdown
Contributor Author

olfek commented Jun 4, 2026

@pepelsbey ---

Well recently, I was working with strings and Blobs, and wondered what the character encoding was, this information is vital when decoding.

Decoding using the wrong character encoding produces something totally different from the original text.

const bytes = await new Blob(["this is a UTF-16 string that will be converted to UTF-8"]).bytes();
console.log(new TextDecoder("UTF-8").decode(bytes)); // this is a UTF-16 string that will be converted to UTF-8
console.log(new TextDecoder("UTF-16").decode(bytes)); // 桴獩椠⁳⁡呕ⵆ㘱猠牴湩⁧桴瑡眠汩敢挠湯敶瑲摥琠呕ⵆ�

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

Labels

Content:WebAPI Web API docs size/xs [PR only] 0-5 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants