See my minimal example:
var { exec } = require('child_process');
var out;
exec('echo oø', options={encoding: 'buffer'} callback=(err, stdout, stderr) => { out = stdout});
No matter the encoding configuration of exec options and out.toString(encoding=''), oo is passed. Evidently when using 'buffer' encoding in exec, i get:
out:
<Buffer 6f 6f 0d 0a>
out.toString():
‘oo\r\n’
Any ideas how to get exec to return "oø" when calling "echo oø"?