L
L
LittleBuster2014-11-12 12:45:21
C++ / C#
LittleBuster, 2014-11-12 12:45:21

Curl special characters and C?

I just can't send Russian text from C via curl to google translate.

char url[4096];
strcpy(url, "http://translate.google.com/translate_tts?tl=ru&q=");
strcat(url, curl_easy_escape(curl_handle, text, strlen(text));

In text I have Russian sentences. He translates them into the format %D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1 and sends them. But googletranslate reads them at random, talking about some 3/4, 1/2, euros, degrees ... and percentages, I just haven’t tried it. Maybe some problems with the encoding or something else?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fedor Laktionov, 2015-06-10
@megat72

Uniform Resource Identifier (URI): Generic Syntax [RFC 3986]:
Those. yes, it's most likely a matter of encoding: text must be encoded in UTF-8 before serving to curl_easy_escape .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question