Full Unicode strings strawman

Brendan Eich brendan at mozilla.com
Thu May 19 10:35:44 PDT 2011


On May 19, 2011, at 10:27 AM, Shawn Steele wrote:

>> The crucial win of Allen's proposal comes down the road, when someone in a certain locale *can* do s.indexOf(nonBMPChar) and win.
> s.indexOf("\U+10000"),

Ok, but "\U+..." does not work today.


> who cares that it ends up as UTF-16?  You can already do it, today, with s.indexOf("𐀀"). It happens that 𐀀 looks like d800 + dc00, but it still works.  Today.  This is no different than most other languages.

My example was unclear. I meant something like a one-char indexOf where the result would be used to slice that char.

That doesn't work today. That's the point.

But hey, if JS does not need to change then we can avoid trouble and keep on using 16-bit indexing and length. Is this really the best outcome?

/be



More information about the es-discuss mailing list