How to use Google's Text-to-Speech service for Chinese characters on Android?

白昼怎懂夜的黑 提交于 2019-12-05 05:26:30

So, as it turns out, the problem at the end wasn't the encoding at all; it was the processing at Google's end. To get the service to correctly recognize UTF-8, you need to use this link http://www.translate.google.com/translate_tts?ie=utf-8&tl=zh-cn&q= instead of the one above. Note the ie=utf-8 added to the parameter. So you can just URLEncoder.encode("你好嗎", "UTF-8"), append it to the link, and send it up as per usual. Whew!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!