Source file encoding

Mike Samuel mikesamuel at gmail.com
Mon May 16 17:35:03 PDT 2011


2011/5/16 Allen Wirfs-Brock <allen at wirfs-brock.com>:
> On May 16, 2011, at 5:11 PM, Mike Samuel wrote:
>
>> 2011/5/16 Allen Wirfs-Brock <allen at wirfs-brock.com>:
>>
>>> The actual program might be encoded in EBCDIC or Hollerith card codes as long as there is a mapping of the characters actually used in that encoding to Unicode characters.
>>
>> For ES next, why not mandate that all ES harmony source files not
>> embedded in another language must be encoded using UTF-8.
>>
>
> You are essentially saying that it would be non-complient to build a ES implementation that could take input directly for a UTF-16 or UTF-32 encoded file.  Why? The language definition doesn't care about the external encoding. That's a matter for host environments and implementations to worry about. The current specification already unnecessarily over specifies this.  Doing so adds non-essential complication to the specification that I had to tweak for ES5 and will probably have to tweak again for ES.next.  Why not just get rid of the unnecessary complication.

Because doing so gets rid of complications like character encoding attacks.


> There are, however, two places we will still have to deal with encoding -- the interpretation of the arguments to eval and the Function constructor.


More information about the es-discuss mailing list