On 5/17/11 1:05 PM, Brendan Eich wrote:
If the strings you are combining from different sources have not been 
canonicalize to a common encoding then you better be damn care  how you combine 
them.

Programmers miss this as you note, so arguably things are not much worse, at 
best no worse, with your proposal.

Right now, by the time a string gets into JS in browsers it's been canonicalized into UTF-16, to the best of the browser's ability, unless you explicitly tell it otherwise (e.g. with the "user-defined charset" hackery on XHR).

The DOM seems seems to canonicalize to UTF-16 (with some slop WRT invalid 
encoding that Boris and others have pointed out).  I don't about other sources 
such as XMLHttpRequest or the file APIs.  However, in the long run JS in the 
browser is going to have to be able to deal with arbitrary encodings.  You can 
hide such things form many programmers but not all.  After all, people actually 
have to implement transcoders.

Transcoding to some canonical Unicode representation is often done by the 
browser upstream of JS, and that's a good thing. Declarative specification by 
authors, implementation by relative-few browser i18n gurus, sparing the many JS 
devs the need to worry. This is good, I claim.

Yes. And right now that's how it works and actual JS authors typically don't have to worry about encoding issues. I don't agree with Allen's claim that "in the long run JS in the browser is going to have to be able to deal with arbitrary encodings". Having the _capability_ might be nice, but forcing all web authors to think about it seems like a non-starter.

That it means JS hackers are careless about Unicode is inevitable, and there 
are other reasons for that condition anyway. At least with your strawman there 
will be full Unicode flowing through JS and back into the DOM and layout.

See, this is the part I don't follow. What do you mean by "full Unicode" and how do you envision it flowing?

-Boris
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to