cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl with incorrectly encoded html

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 21 Dec 2009 09:13:29 +0100 (CET)

On Sun, 20 Dec 2009, wsu_cic wrote:

> Hi, I am trying to access www.mitbbs.com. The site mainly uses charset
> 'gb2312' but with some wrongly encoded characters. 'curl
> http://www.mitbbs.com' outputs weird content. Is there a way to set the
> charset used to decode the returned content? If I used IE to download the
> page and 'iconv -f gb18030 -t utf-8 downloaded-file', the content is printed
> correctly.

curl doesn't encode or decode anything in what it receives. It just outputs
the data exactly in the same way it receives it. The server might provide
different data depending on how the request looks like, so if you want exactly
what IE got you should probably make sure that curl's request looks more
similar to IE's...

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
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.html
Received on 2009-12-21