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 10:58:52 +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)

1) I tried to do so:

chcp 65001
curl.exe --verbose --insecure --get --data-urlencode text=привет --url https://yandex.ru/search/

2) I placed the operators in the batch-file. And I converted batch file to utf-8 codepage.

3) I tried to use PowerShell.

But it did not give effect.

-------------------------------------------------------------------
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