Re: [PHP] SimpleXMLElement occasionally fails to parse gb2312 or big5 feeds

2010-04-06 Thread Dan Joseph
On Fri, Apr 2, 2010 at 10:28 AM, Peter Pei peterpei...@hotmail.com wrote:


 I use the following code to get rss and parse it, but the code occasionally
 have issues with gb2312 or big-5 encoded feeds, and fails to parse them.
 However other times may appear just okay. Any thoughts? Maybe
 SimpleXMLElement is simply not meant for other language encodings...

$page = file_get_contents($rss);
try {
$feed = new SimpleXMLElement($page);



I've been learning a bit about SimpleXML today myself.  It seems that it
misses a lot of things when it comes to complex, or abnormal XML.  Abnormal
being what you're describing and whatnot.  I don't really have a solid
answer for you (Just noticed no one  responded), but I think you're running
into what I was...  Its just built to be Simple, not expand its mind.

Hope that helps!

-- 
-Dan Joseph

www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
Code NEWTHINGS for 10% off initial order

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry


[PHP] SimpleXMLElement occasionally fails to parse gb2312 or big5 feeds

2010-04-02 Thread Peter Pei


I use the following code to get rss and parse it, but the code  
occasionally have issues with gb2312 or big-5 encoded feeds, and fails to  
parse them. However other times may appear just okay. Any thoughts? Maybe  
SimpleXMLElement is simply not meant for other language encodings...


$page = file_get_contents($rss);
try {
$feed = new SimpleXMLElement($page);


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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