-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-add readAsBinaryString() #44
Re-add readAsBinaryString() #44
Conversation
This doesn't seem to actually define/update the read operation? |
https://w3c.github.io/FileAPI/#readOperationSection is used for all of the readXXX() methods. Can you clarify what is missing and/or needs updating? |
7. To <a>process read data</a> <a>fire a progress event</a> called {{progress}} at the <a>context object</a>. | ||
8. To <a>process read EOF</a> run these substeps: | ||
1. Set {{FileReader/readyState}} to {{FileReader/DONE}} | ||
2. Set the {{FileReader/result}} attribute to the <a>body</a> returned by the <a>read operation</a> as a <a>binary string</a>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found this particularly confusing. Having this be some kind of operation that ends up converting bytes to a string would make it clearer. Currently it seems to invoke a non-normative description of "binary string"...
This CL matches the style for the other methods. I agree they should be improved, but ISTM that should be done separately so they are consistent. https://w3c.github.io/FileAPI/#dfn-result has:
... and then proceeds to define how the various methods generate result types, which (with this CL) defines binary string. And that section could also be improved, but again this CL just matches the existing style. |
Mkay... The existing style is not great. |
Agreed that the way these read operations are defined isn't great, and that it would be nice to have a more explicit definition of "binary string". I filed #45 to reword these things. |
It was re-added to the specification in w3c/FileAPI#44.
It was re-added to the specification in w3c/FileAPI#44.
It was re-added to the specification in w3c/FileAPI#44.
In spec drafts circa 2011 a readAsBinaryString() method was present, predating Typed Array and readAsArrayBuffer() support. Per #39 this is supported by all major browsers and used in a variety of libraries, so we should accept it as a web-compat necessity and specify it.