say.js
say.js copied to clipboard
How to read Chinese?
Reading Chinese will be garbled
eg. 我想吃饭 -> %E6%88%91%E6%83%B3%E5%90%83%E9%A5%AD
Works fine for me.
const say = require('say')
say.export("出租汽车", 'Ting-Ting', 1, 'taxi.wav', (err) => {
if (err) {
return console.error(err)
}
console.log('Text has been saved to taxi.wav.')
})
Hi guys, I have found a solution for Chinese, please check this if you like.
On Windows
you need to change the terminal encoding to UTF8.
- Run
chcp
on the terminal to see the current encoding. - Run
chcp 65001
to change the encoding to UTF8. Then re-execute the JS file.
Example:
chcp 65001 && node demo.js
On
Windows
you need to change the terminal encoding to UTF8.
- Run
chcp
on the terminal to see the current encoding.- Run
chcp 65001
to change the encoding to UTF8. Then re-execute the JS file.Example:
chcp 65001 && node demo.js
Sorry, I am not sure, the say.js is embeded in the plugin I needed, so that it will always reset to chcp 936 when running. I'll see if I can make it work in this way.
Thanks!!!