JEP 330: Launch Single-File Source-Code Programs
Jonathan Gibbons
jonathan.gibbons at oracle.com
Mon Mar 26 22:32:38 UTC 2018
Rémi,
The problem is that the first line of a shebang file is effectively read
twice.
It is initially read by the operating system, as part of the operation
of the shebang feature. That happens before the executable named in the
first line is even invoked, and is therefore out of the control of any
executable that might be named.
Then, the executable is invoked giving the shebang file as an argument.
The executable will read the file, including the first line. Since we
have no ability to mandate any specific format, the best we can do is to
go with what the operating system provides.
-- Jon
On 03/26/2018 02:55 PM, Remi Forax wrote:
> "All subsequent bytes are read with the default platform character encoding that is in effect."
> should we not mandate UTF8 instead ?
>
> Rémi
>
> ----- Mail original -----
>> De: "mark reinhold" <mark.reinhold at oracle.com>
>> À: "jonathan gibbons" <jonathan.gibbons at oracle.com>
>> Cc: "compiler-dev" <compiler-dev at openjdk.java.net>
>> Envoyé: Lundi 26 Mars 2018 23:41:36
>> Objet: JEP 330: Launch Single-File Source-Code Programs
>> New JEP Candidate: http://openjdk.java.net/jeps/330
>>
>> - Mark
More information about the compiler-dev
mailing list