cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 31 Mar 2016 09:02:33 +0200 (CEST)

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)

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
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