|
|
|
#1
|
|||
|
|||
|
So I'm trying to load the channel XML file with php using
Code:
<?php $doc = new DOMDocument(); $xml = "http://channel.api.livestream.com/1.0/info?channel=oystein123" $doc->load($xml); ?> Code:
Warning: DOMDocument::load() [domdocument.load]: Input is not proper UTF-8, indicate encoding ! Bytes: 0xD8 0x79 0x73 0x74 in http://channel.api.livestream.com/1.0/info?channel=oystein123 is there a fix to this? Last edited by kentor; 8th September 2009 at 03:08. |
|
#2
|
|||
|
|||
|
Tested this, should work:
<?php $myXMLString = file_get_contents("http://channel.api.livestream.com/1.0/info?channel=oystein123"); $myXMLString = utf8_decode($myXMLString); $doc = new DOMDocument('1.0', 'iso-8859-1'); $doc->loadXML($myXMLString); echo $doc->saveHTML(); ?> |
|
#3
|
|||
|
|||
|
it doesn't give an error anymore but the special characters are just replaced by a "?".
plus I think this method is kind of slow and it uses a lot more resources especially if you want to do this for lots of channels thanks for the help though Last edited by kentor; 10th September 2009 at 22:00. |
|
#4
|
|||
|
|||
|
Thanks for reporting this, we're going to take a look at it and will let you know.
|
|
#5
|
|||
|
|||
|
This works fine for me:
PHP Code:
|
![]() |
| Tags |
| api, channel, encoding, error, utf-8 |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|