For the first time I come across this:
This:
https://tts.voicetech.yandex.net/generate?text=Наш%20текст%20гот+ов&format=mp3&lang=ru-RU&speaker=zahar&emotion=good&key=<API‑ключ> We need to convert this into this:
https://tts.voicetech.yandex.net/generate?text=%D0%9D%D0%B0%D1%88%20%D1%82%D0%B5%D0%BA%D1%81%D1%82%20%D0%B3%D0%BE%D1%82+%D0%BE%D0%B2&format=mp3&lang=ru-RU&speaker=zahar&emotion=good&key=<API‑ключ> How does this happen? What does he translate Cyrillic to?
I read. I found out.
URL url1 = new URL("https://tts.voicetech.yandex.net/generate?text=Наш%20текст%20гот+ов&format=mp3&lang=ru-RU&speaker=zahar&emotion=good&key=<API‑ключ>"); String s = url1.toString(); s = URLEncoder.encode(s, "utf-8"); URL url = new URL(s); does not work.
What's wrong?
In general, with this use goes like this:
It was :
https://tts.voicetech.yandex.net/generate?text=Наш%20текст%20гот+ов&format=mp3&lang=ru-RU&speaker=zahar&emotion=good&key= It became:
https%3A%2F%2Ftts.voicetech.yandex.net%2Fgenerate%3Ftext%3D%D0%9D%D0%B0%D1%88%2520%D1%82%D0%B5%D0%BA%D1%81%D1%82%2520%D0%B3%D0%BE%D1%82%2B%D0%BE%D0%B2%26format%3Dmp3%26lang%3Dru-RU%26speaker%3Dzahar%26emotion%3Dgood%26key% Conclusion :
it turns utf-8 into everything. How to turn only Russian letters?