- From: Anne van Kesteren <notifications@github.com>
- Date: Thu, 28 May 2026 01:27:50 -0700
- To: w3c/FileAPI <FileAPI@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/FileAPI/pull/221/review/4379200777@github.com>
@annevk commented on this pull request.
> @@ -647,8 +647,17 @@ The <dfn method for=Blob>bytes()</dfn> method, when invoked, must run these step
### The {{Blob/textStream()}} method ### {#text-stream-method-algo}
-The <dfn method for=Blob>textStream()</dfn> method, when invoked, must return
-the result of calling [=get stream=] on [=this=], [=pipe through|piped through=] a new {{TextDecoderStream}} object.
+The <dfn method for=Blob>textStream()</dfn> method, when invoked, must run these steps:
method steps are:
> @@ -647,8 +647,17 @@ The <dfn method for=Blob>bytes()</dfn> method, when invoked, must run these step
### The {{Blob/textStream()}} method ### {#text-stream-method-algo}
-The <dfn method for=Blob>textStream()</dfn> method, when invoked, must return
-the result of calling [=get stream=] on [=this=], [=pipe through|piped through=] a new {{TextDecoderStream}} object.
+The <dfn method for=Blob>textStream()</dfn> method, when invoked, must run these steps:
+
+1. Let |stream| be the result of calling [=get stream=] on [=this=].
+1. Let |decoder| be a new {{TextDecoderStream}} in [=this=]'s [=relevant realm=].
+1. [=set up a text decoder stream|Set up=] |decoder| with [=UTF-8=].
+1. Return the result of calling |stream|, [=pipe through|piped through=] |decoder|.
+
+Note: This is different from the behavior of {{FileReader/readAsText()}} to align better
+with the behavior of {{Body/textStream()|Fetch's textStream()}}. Specifically this method will always
+use UTF-8 as encoding, while {{FileReader}} can use a different encoding depending on
+the blob's type and passed in encoding name.
I'm not sure we need all this detail captured here. Maybe just:
> Note: This differs from readAsText() in that it always uses the UTF-8 encoding.
--
Reply to this email directly or view it on GitHub:
https://github.com/w3c/FileAPI/pull/221#pullrequestreview-4379200777
You are receiving this because you are subscribed to this thread.
Message ID: <w3c/FileAPI/pull/221/review/4379200777@github.com>
Received on Thursday, 28 May 2026 08:27:54 UTC