You are here: fopen GB2312 encoding problem « PHP Programming Language « IT news, forums, messages
fopen GB2312 encoding problem

Posted by Sadie on 06/25/07 07:58

Hi,

I am trying to read in a url which is encoded in GB2312 (http://
top.baidu.com/winkvane.html). I have tried other pages with this
encoding and each time I get a connection time out error. It seems
that fopen cannot open a webpage in GB2312. Is there a way around
this? Has anyone else had this sort of problem?

Here is an example with some simple code (using PHP5):

$file = fopen("http://top.baidu.com/winkvane.html", "r") or
exit("Unable to open file!");

while(!feof($file))
{
echo fgets($file). "<br />";
}
fclose($file);

Any ideas would be greatly appreciated! Thank you.
Sadie

 

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

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