Tuesday 22 May 2018

Node child_process.exec Displays Special Characters as Question Marks

I'm running a test using Node's child_process.exec to execute an echo statement with special characters in it.const {exec} = require('child_process'); try { exec("echo téstér", function(err, stdout, stderr) { console.log(stdout) }); } catch(e){ console.log(e.message) } When running this on my Linux machine, I get the téstér value I was expecting. When I run it on my Windows machine I get back t?st?r.Am I missing something when I call the exec function to have my special characters appear?

Submitted May 22, 2018 at 07:36PM by -Captain--Hindsight

No comments:

Post a Comment