J
J
justdance1112021-07-03 14:35:32
bash
justdance111, 2021-07-03 14:35:32

Why does Git Bash incorrectly pass Cyrillic in the request and Yandex Speech kit does not recognize it?

I send such a request to yandex speech kit.
Anything in Cyrillic in the $TEXT variable is not recognized by the Yandex server, or is transmitted incorrectly and speech is generated only from English characters and numbers. What can be done?

$ export TEXT="Привет мир короче"
$ export FOLDER_ID=папка
$ export IAM_TOKEN=тут токен
$ curl -X POST \
     -H "Authorization: Bearer ${IAM_TOKEN}" \
     --data-urlencode "text=${TEXT}" \
     -d "lang=ru-RU&folderId=${FOLDER_ID}&voice=filipp" \
     "https://tts.api.cloud.yandex.net/speech/v1/tts:synthesize" > speech.ogg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2021-07-05
@MechanID

check what encoding your script is in, run the file /path/to/script
command if the file info contains ASCII, then most likely this is the problem, and you need to convert the file to UTF-8

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question