Case transformations in strings

David-Sarah Hopwood david.hopwood at
Tue Mar 24 12:24:45 PDT 2009

David-Sarah Hopwood wrote:
> Christian Plesner Hansen wrote:
>> David-Sarah Hopwood wrote:
>>> If converting one character to many would cause a problem with the
>>> reference to toUpperCase in the regular expression algorithm, then
>>> presumably Safari and Chrome would hit that problem. Do they, or
>>> do they use different uppercase conversions for regexps vs
>>> toUpperCase?
>> Chrome uses context (but not locale) sensitive special casing for
>> ordinary toUpperCase.  For regexps it uses the same mapping but
>> doesn't convert chars that map to more than one char and non-ascii
>> chars that would have converted to ascii chars.  We would have liked
>> to use the full multi-character mapping without the exception for
>> ascii but couldn't for compatibility reasons.
> Can you expand on what the compatibility problem was for
> non-ASCII -> ASCII mappings in regexps?

Oh, never mind -- this is required by step 5 of Canonicalize in section

So, there would be no regexp-related problems with requiring toUpperCase
to perform multi-code-unit and/or context-sensitive mappings in ES3.1.

David-Sarah Hopwood ⚥

More information about the Es-discuss mailing list