Re: Char encoding using fget or curl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, July 18, 2005 2:14 pm, Marcelo Volmaro said:
> I need to get some information from a webpage, that is served as UTF-8.
> I need that information because the page contains different language
> characters. The problem is that no matter if I use fget or the CURL
> libraries, i got the information in ISO-8859-1.
> How can i overcome this? Take in consideration that not all UTF-8 can be
> converted to ISO-8859-1 (chinese, for example)

WILD GUESSES!!!

There might be a CURLOPT_CHARSET or similar constant that is not
documented on php.net, and that might not have made it into PHP as a
constant even, but if you read the original curl docs will tell you how to
do it...

You might have to do something like:
if (!defined('CURLOPT_CHARSET')) define('CURLOPT_CHARSET', 47);
just to have the constant available.


It's also entirely possible that curl, by default, sends some kind of
default "Accepts: charset=ISO-8859-1" header or something similar, and you
just need to send some *other* header to tell the web-server that your
browser "understands" UTF-8.  Or maybe even that you specifically want the
results in Chinese or whatever...  I know a lot of webservers/browsers
don't implement the language-preference for the browser/user, but *MAYBE*
it will have some effect.

Just some ideas from a guy who knows he's WAY too stupid to ever have
multi-lingual anything working on his own web-site. :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux