Re: String to ArrayBuffer

2012-01-12 Thread Glenn Adams
On Thu, Jan 12, 2012 at 3:49 AM, Henri Sivonen hsivo...@iki.fi wrote: On Thu, Jan 12, 2012 at 1:12 AM, Kenneth Russell k...@google.com wrote: The StringEncoding proposal is the best path forward because it provides correct behavior in all cases. Do you mean this one?

Re: String to ArrayBuffer

2012-01-12 Thread Tab Atkins Jr.
On Thu, Jan 12, 2012 at 8:59 AM, Glenn Adams gl...@skynav.com wrote: On Thu, Jan 12, 2012 at 3:49 AM, Henri Sivonen hsivo...@iki.fi wrote: On Thu, Jan 12, 2012 at 1:12 AM, Kenneth Russell k...@google.com wrote: The StringEncoding proposal is the best path forward because it provides correct

Re: String to ArrayBuffer

2012-01-12 Thread Glenn Adams
On Thu, Jan 12, 2012 at 10:10 AM, Tab Atkins Jr. jackalm...@gmail.comwrote: On Thu, Jan 12, 2012 at 8:59 AM, Glenn Adams gl...@skynav.com wrote: On Thu, Jan 12, 2012 at 3:49 AM, Henri Sivonen hsivo...@iki.fi wrote: On Thu, Jan 12, 2012 at 1:12 AM, Kenneth Russell k...@google.com wrote:

Re: String to ArrayBuffer

2012-01-12 Thread Tab Atkins Jr.
On Thu, Jan 12, 2012 at 9:54 AM, Charles Pritchard ch...@jumis.com wrote: I don't see it being a particularly bad thing if vendors expose more translation encodings. I've only come across one project that would use them. Binary and utf8 handle everything else I've come across, and I can use

Re: String to ArrayBuffer

2012-01-12 Thread Charles Pritchard
On Jan 12, 2012, at 9:17 AM, Glenn Adams gl...@skynav.com wrote: On Thu, Jan 12, 2012 at 10:10 AM, Tab Atkins Jr. jackalm...@gmail.com wrote: On Thu, Jan 12, 2012 at 8:59 AM, Glenn Adams gl...@skynav.com wrote: On Thu, Jan 12, 2012 at 3:49 AM, Henri Sivonen hsivo...@iki.fi wrote: On

Re: String to ArrayBuffer

2012-01-12 Thread Charles Pritchard
On 1/12/2012 10:03 AM, Tab Atkins Jr. wrote: On Thu, Jan 12, 2012 at 9:54 AM, Charles Pritchardch...@jumis.com wrote: I don't see it being a particularly bad thing if vendors expose more translation encodings. I've only come across one project that would use them. Binary and utf8 handle

String to ArrayBuffer

2012-01-11 Thread Charles Pritchard
Currently, we can asynchronously use BlobBuilder with FileReader to get an array buffer from a string. We can of course, use code to convert String.fromCharCode into a Uint8Array, but it's ugly. The StringEncoding proposal seems a bit much for most web use:

Re: String to ArrayBuffer

2012-01-11 Thread Charles Pritchard
On 1/11/2012 2:49 PM, James Robinson wrote: On Wed, Jan 11, 2012 at 2:45 PM, Charles Pritchard ch...@jumis.com mailto:ch...@jumis.com wrote: Currently, we can asynchronously use BlobBuilder with FileReader to get an array buffer from a string. We can of course, use code to

Re: String to ArrayBuffer

2012-01-11 Thread Charles Pritchard
On 1/11/2012 2:49 PM, James Robinson wrote: On Wed, Jan 11, 2012 at 2:45 PM, Charles Pritchard ch...@jumis.com mailto:ch...@jumis.com wrote: Currently, we can asynchronously use BlobBuilder with FileReader to get an array buffer from a string. We can of course, use code to

Re: String to ArrayBuffer

2012-01-11 Thread James Robinson
On Wed, Jan 11, 2012 at 2:45 PM, Charles Pritchard ch...@jumis.com wrote: Currently, we can asynchronously use BlobBuilder with FileReader to get an array buffer from a string. We can of course, use code to convert String.fromCharCode into a Uint8Array, but it's ugly. The StringEncoding

Re: String to ArrayBuffer

2012-01-11 Thread Kenneth Russell
The StringEncoding proposal is the best path forward because it provides correct behavior in all cases. Adding String conversions directly to the typed array spec will introduce dependencies that are strongly undesirable, and make it much harder to implement the core spec. Hopefully Josh can

Re: String to ArrayBuffer

2012-01-11 Thread Charles Pritchard
On 1/11/2012 3:12 PM, Kenneth Russell wrote: The StringEncoding proposal is the best path forward because it provides correct behavior in all cases. Adding String conversions directly to the typed array spec will introduce dependencies that are strongly undesirable, and make it much harder to

Re: String to ArrayBuffer

2012-01-11 Thread Joshua Bell
On Wed, Jan 11, 2012 at 3:12 PM, Kenneth Russell k...@google.com wrote: The StringEncoding proposal is the best path forward because it provides correct behavior in all cases. Adding String conversions directly to the typed array spec will introduce dependencies that are strongly undesirable,

Re: String to ArrayBuffer

2012-01-11 Thread Boris Zbarsky
On 1/11/12 6:03 PM, Charles Pritchard wrote: Is there any instance in practice where DOMString as exposed to the scripting environment is not implemented as a unicode string? I don't know what you mean by that. The point is, it's trivial to construct JS strings that contain arbitrary

Re: String to ArrayBuffer

2012-01-11 Thread Charles Pritchard
On 1/11/2012 4:22 PM, Boris Zbarsky wrote: On 1/11/12 6:03 PM, Charles Pritchard wrote: Is there any instance in practice where DOMString as exposed to the scripting environment is not implemented as a unicode string? I don't know what you mean by that. The point is, it's trivial to

Re: String to ArrayBuffer

2012-01-11 Thread Charles Pritchard
On 1/11/2012 7:44 PM, Charles Pritchard wrote: On 1/11/2012 4:22 PM, Boris Zbarsky wrote: On 1/11/12 6:03 PM, Charles Pritchard wrote: Web Storage, also, only works with unicode. I'm not familiar with the relevant part of Web Storage. Can you cite the relevant part please? The character