say.js icon indicating copy to clipboard operation
say.js copied to clipboard

How to read Chinese?

Open wangrongding opened this issue 3 years ago • 6 comments

Reading Chinese will be garbled

wangrongding avatar Jun 10 '21 03:06 wangrongding

eg. 我想吃饭 -> %E6%88%91%E6%83%B3%E5%90%83%E9%A5%AD

wangrongding avatar Jun 10 '21 04:06 wangrongding

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.')
})

loicpirez avatar Jun 11 '21 02:06 loicpirez

Hi guys, I have found a solution for Chinese, please check this if you like.

silence19 avatar Jul 23 '21 00:07 silence19

On Windows you need to change the terminal encoding to UTF8.

  1. Run chcp on the terminal to see the current encoding.
  2. Run chcp 65001 to change the encoding to UTF8. Then re-execute the JS file.

Example: chcp 65001 && node demo.js

Kayakyx avatar May 28 '22 12:05 Kayakyx

On Windows you need to change the terminal encoding to UTF8.

  1. Run chcp on the terminal to see the current encoding.
  2. 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.

silence19 avatar May 31 '22 15:05 silence19

Thanks!!!

zld150 avatar Jan 13 '23 07:01 zld150