cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re[2]: Why URL encoding takes place in different ways in Linux and in Windows?

From: kme <k-me_at_rambler.ru>
Date: Thu, 31 Mar 2016 11:36:40 +0300

> On Thu, 31 Mar 2016, kme wrote:

> I'm pretty sure this is because of different charset encodings in the
> different shell environments.

> The URL encoding curl does for these situations is: for each byte in the given
> string that isn't a legal URL character, percent encode it. Clearly your
> windows and Linux setups pass in different byte sequences for the same string.

> Which then implies different encodings.

>>> GET /search/?text=%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82 HTTP/1.1

> That's UTF-8!

>>> GET /search/?text=%EF%F0%E8%E2%E5%F2 HTTP/1.1

> That looks very much like windows code page 1251
> (https://msdn.microsoft.com/en-us/library/cc195053.aspx)

Can it be necessary to replace the declaration of main-function (tool_main.c) to such:
int _tmain(int argc, _TCHAR *argv[])

Instead of this:
int main(int argc, char *argv[])

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-users
FAQ: https://curl.haxx.se/docs/faq.html
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-03-31