Question

Can anyone help me with this one

I have this query and only after adding the last one wich is indexed against the euro I get invalid json.

$url = 'http://www.google.com/finance/info?client=ig&q=goog,yhoo,AMS:TOM2';
$response= json_decode($response,true); 

The only thing different if I directly echo the output is the questionmark in the json.

What would I use to replace the eurosign in the json return?, - and hopefully that will solve it.

thanks in adv, Richard

Was it helpful?

Solution

The JSON is valid ISO-8859-1, or Latin1. If your application is using some other encoding, say UTF-8, you need to convert the encoding of the response from Latin1 to UTF-8.

OTHER TIPS

json_encode and json_decode expect in/output to be utf-8. PHP defaults to use iso-8859-1 as charset. So you may have to convert. (Note that the euro sign doesn't exist in iso-8859-1).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top