Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

UTF-8 with BOM encoded scripts fail #1440

@diversario

Description

@diversario

If you try to run a UTF-8 with BOM encoded script like

#!/usr/bin/env node

console.log("UTF8!");

it fails with

./test.js: 1: #!/usr/bin/env: not found
./test.js: 3: Syntax error: word unexpected (expecting ")")

if run as executable script or

test.js:1
#!/usr/bin/env
 ^

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
SyntaxError: Unexpected token ILLEGAL

if given to node.
Scripts encoded in ANSI or UTF-8 without BOM work fine.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions