cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: doing post with Latin-2 encoding

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 3 Sep 2002 14:40:55 +0200 (MET DST)

On Tue, 3 Sep 2002, [iso-8859-2] Grzegorz Kwaczyński wrote:

> I need to post a file which is ISO-8859-2 encoded.

There is no particular magic involved to post files using whatever charset
you want. curl has no idea of charsets, what they are or what you use.

> Is there any work-around? I try to do
>
> curl -F 'file=@data.xml;type=text/xml;; charset=iso-8859-2' www.dot.com

Hm, the problem here is that the ';' letter in the type string is used as a
separator by the curl tool so it won't be used in the actual Content-Type
string passed to the server (which --trace probably show you pretty clearly).

At least that is what I suspect happens.

> but the server receives only ? instead of my national characters. The
> server works in ISO-8859-2 mode, however.

Does it *REALLY* receive only ?-letters or does it somehow display that in
the other end?

Use the --trace option to see what curl sends off to the remote end, I doubt
very much that it sends ?-letters in the data, unless of course your file
contains such ones. curl doesn't encode or translate the data in any way.

I think the fix you need here, is to somehow patch src/main.c:formparse() to
be able to get the charset string too when you specify the Content-Type like
that. I don't have an immediate fix or work-around. Sorry!

-- 
 Daniel Stenberg -- curl related mails on curl related mailing lists please
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r
Received on 2002-09-03