Info about Blob blobParts strings encoding#44324
Open
olfek wants to merge 1 commit into
Open
Conversation
Contributor
|
Preview URLs (1 page) External URLs (1)URL:
|
pepelsbey
reviewed
Jun 4, 2026
Member
pepelsbey
left a comment
There was a problem hiding this comment.
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.
Contributor
Author
|
@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)); // 桴獩椠呕ⵆ㘱猠牴湩桴瑡眠汩敢挠湯敶瑲摥琠呕ⵆ� |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.