むっちゃ能動的にUTF-8を受け取ってるのかもしれない
$ echo 'console.log("𠮷".length)' | iconv -f utf-8 -t utf-8 | node
2
$ echo 'console.log("𠮷".length)' | iconv -f utf-8 -t utf-16 | node
[stdin]:1
��c
SyntaxError: Invalid or unexpected token
at new Script (node:vm:93:7)
at createScript (node:vm:248:10)
at Object.runInThisContext (node:vm:296:10)
at node:internal/process/execution:83:21
at [stdin]-wrapper:6:24
at runScript (node:internal/process/execution:82:62)
at evalScript (node:internal/process/execution:104:10)
at node:internal/main/eval_stdin:31:5
at Socket.<anonymous> (node:internal/process/execution:205:5)
at Socket.emit (node:events:526:35)
Node.js v20.8.0