curl-users
Character encoding problem in windows when using --data-binary and special characters like 'Ñ'
Date: Thu, 2 Feb 2012 12:54:58 +0100
Hi.
I'm Ricardo Vila and i'm new to this mailing list.
Briefly: i'm facing a problem using command line curl in windows
platforms to send data stored in properties files. I hope somebody can
point me a solution.
Te complete situation is as follows. At Teimas, we have one app wich
accepts REST requests. This requests has a lot of fields so our
clients store the parameters in a properties file and then send it
with curl and the --data-binary option. Something like this (windows
example):
curl.exe -i -u :'some_token' -H "Accept: application/x-yaml" -H
"Content-type: text/plain" http://ourserver.com/api/nt/ --data-binary
@file.properties -X POST
This works fine running curl form linux and windows. But in windows
appears one problem when in the properties file, appears something
like this:
documento.productor.centro.nombre=XESTION A CORUÑA, S.A.
The Ñ character is encoded (in windows clients) in a way that our
server cannot handle it and the rest of the line is trunked. So the
value on our server for this example is 'XESTION A CORU'
We have tried many things like:
- Use --data-urlencode option (with and without changing content-type)
- Use --data option
- Use --data-urlencode with -crlf
- May combination of the above options
I know that de manual page says ' The contents of the file must
already be URL-encoded.' but i wonder if i can let curl command manage
this.
¿I'm missing something? ¿Any idea?
Thanks in advance
-- Ricardo Vila Avendaño Teimas Desenvolvemento S.L. ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-users FAQ: http://curl.haxx.se/docs/faq.html Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2012-02-02