You are here: Re: [PHP] Char encoding using fget or curl « PHP « IT news, forums, messages
Re: [PHP] Char encoding using fget or curl

Posted by "Richard Lynch" on 07/22/05 11:39

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация