473,246 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,246 software developers and data experts.

Yahoo API + PHP5: "Unknown encoding utf-8"?

I want to try the new Yahoo API, but I get the PHP5 error message

Unknown encoding "utf-8"

in the marked line below...
(After that, applying the Xpath will fail as symptom of the first bug.)

function showImages($q)
{

$image_url = 'http://api.search.yahoo.com/' .
'ImageSearchService/V1/imageSearch?' .
'appid=YahooDemo&query=' . urlencode($q) . '&results=5';

$dom = new domdocument; // ERROR!

$dom->load($image_url);
$xpath = new domxpath($dom);

$xNodes = $xpath->query('//Result');
foreach ($xNodes as $xNode)
{
// ...
}
}
Can anyone help? I tried some encoding workarounds but nothing
worked... note my direct file access with PHP5 is disabled on my server
(using file() or fopen()).

--
Google Blogoscoped
http://blog.outer-court.com
Jul 17 '05 #1
3 2972
Philipp Lenssen wrote:
I want to try the new Yahoo API, but I get the PHP5 error message

Unknown encoding "utf-8"

<snip>

This is not an answer to your question. FWIW, I did look at the SDK
<http://developer.yahoo.net/download/download.html> and the PHP code
written by Rasmus Lerdorf. I have the *humble opinion* that this code
could have been written better--with better standard and style.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jul 17 '05 #2
R. Rajesh Jeba Anbiah wrote:
Philipp Lenssen wrote:
I want to try the new Yahoo API, but I get the PHP5 error message

Unknown encoding "utf-8"

<snip>

This is not an answer to your question. FWIW, I did look at the SDK
<http://developer.yahoo.net/download/download.html> and the PHP code
written by Rasmus Lerdorf. I have the *humble opinion* that this code
could have been written better--with better standard and style.


You might be right. I just posted something in my blog on that today:
http://blog.outer-court.com/archive/2005-03-03-n69.html

I wish there'd be a working PHP5 sample using the more modern native
DOM/XML classes.
Jul 17 '05 #3
Philipp Lenssen wrote:
Philipp Lenssen wrote:
I want to try the new Yahoo API, but I get the PHP5 error message

Unknown encoding "utf-8"

<snip>


Update; I sort of solved it, with a hack:
http://blog.outer-court.com/archive/2005-03-04-html#n49
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Colin McGuigan | last post by:
Shorter: How do I tell DOMDocument->load() what encoding I want it to use? Longer: I search for and process XML files from elsewhere, and need to transform them with some XSLTs. No problem. ...
3
by: xmlguy | last post by:
XmlTextReader myXmlReader = new XmlTextReader(args); string en = myXmlReader.Encoding.EncodingName; //Console.WriteLine(x); Error: Unhandled Exception: System.NullReferenceException: Object...
8
by: Demon News | last post by:
I'm trying to do a transform (Using XmlTransform class in c#) and in the Transform I'm specifying the the output xsl below: <xsl:output method="xml" encoding="UTF-8" indent="no"/> the...
2
by: J Huntley Palmer | last post by:
I am having a horrific time integrating uw-imap's c-client for imap support in php. The problem is a whole bunch of "Text relocation remains referenced against symbol" errors during linking....
2
by: John | last post by:
I am updating an xml column in SQLServer 2005, but it always gives me an error "XML parsing: line 1, character 38, unable to switch the encoding" my csharp is like the following ...
1
by: R | last post by:
Hi All, I'm using UTF-8 encoding for my PHP scripts, output is also UTF-8. all files have UTF-8 BOM: 0xEF 0xBB 0xBF at the beginning I have PHP Version 5.1.2 on WinNT and PHP 5.1.1 on Gentoo...
0
by: R | last post by:
Hi all, I have a simple question about locale and PHP5. I'm using polish characters but I encode them in UTF-8. I was sorting an array with usort($array, 'strcoll'); but I've entred a...
0
by: cty | last post by:
Title: Problem in session using php5 Good day, I use php5+mySQL4+IIS5.x Previuosly i use php4 and no error occur,
6
by: working_boy | last post by:
Hello! I am transferring large php application which also uses few third party php libraries to UTF-8. And now, of course I have problems with string functions which are not multi-byte safe,...
15
by: maya | last post by:
hi, this site, http://www.mta.info/lirr/ has a "google translate" widget (on left column); when you click on drop-down some languages don't display properly (encoding problem), this problem...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.