Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Issue 398149 Text Encoding API
Starred by 5 users Project Member Reported by jsb...@chromium.org, Jul 28 2014 Back to list
Status: Fixed
Owner:
Closed: Oct 2014
Cc:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Launch-OWP
Launch-Accessibility: ----
Launch-Legal: ----
Launch-M-Approved: ----
Launch-M-Target: ----
Launch-Privacy: ----
Launch-Security: ----
Launch-Status: ----
Launch-Test: ----
Launch-UI: ----

Blocked on:
issue 243354



Sign in to add a comment
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


 
Comment 1 by jans...@gmail.com, 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?
Comment 2 by jsb...@chromium.org, Oct 27 2014
Status: Fixed
Ah, yes - this was filed as a launch tracking bug. Implementation was tracked in issue 243354 - but this should be close.
Comment 3 by jsb...@chromium.org, 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.)

Sign in to add a comment