Sign in to add a comment
|Text Encoding API|
|Project Member Reported by jsb...@chromium.org, Jul 28 2014||Back to list|
Change description: Expose text encoding (binary data to/from strings) to script. For example, extract utf-8 encoded data from a Blob fetched over XHR. Changes to API surface: Add TextEncoder, TextDecoder global constructors, which take an encoding label and options. TextEncoder has 'encode()' method, and (surprise!) TextDecoder has 'decode()'. Links: Spec: http://encoding.spec.whatwg.org/#api Support in other browsers: Internet Explorer: no signals Firefox: supported Safari: no signals
Oct 25 2014,
It seems that these APIs are already implemented, so this issue could be probably closed. I just have yet a question: A part of the functionality of TextDecoder is also provided by FileReader. FileReader is async, but TextDecoder not. Is this only needed for FileReader because it can also read files from disk, meaning that I could safely switch to TextDecode?
Oct 27 2014,
Ah, yes - this was filed as a launch tracking bug. Implementation was tracked in issue 243354 - but this should be close.
Oct 27 2014,
Re: FileReader Yes, that API is wrapping up both the async reading (e.g. from disk, or shipping data across processes) and decoding (synchronous - since it's a pure memory operation). If you've got all the data in-process already you can use the sync API. (Although if you were processing large amounts of data you might want to defer it to a Worker.)
Where is Chromium's Encoding API support documented?
|► Sign in to add a comment|