Re: [PHP] Malformed UTF-8 Data in JSON [SOLVED]

2010-07-15 Thread Benjamin Hawkes-Lewis
On 15 Jul 2010, at 04:12, Dave M G wrote:
 Yes, stripslashes() was the problem. I've removed it and the code works.
 
 However, it seems that when I send JSON data from a Javascript file, 
 stripslashes() is necessary. That's why I had it there. I'm not entirely sure 
 what's going on there, so obviously more experimentation is needed.

Presumably, thanks to your PHP settings, you need stripslashes() on all $_GET, 
$_POST, and $_COOKIE input.

http://www.php.net/manual/en/info.configuration.php#ini.magic-quotes-gpc

This does not apply to input from other sources.

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



Re: [PHP] Malformed UTF-8 Data in JSON [SOLVED]

2010-07-14 Thread Dave M G

Jim,

Thank you for responding.

Yes, stripslashes() was the problem. I've removed it and the code works.

However, it seems that when I send JSON data from a Javascript file, 
stripslashes() is necessary. That's why I had it there. I'm not entirely 
sure what's going on there, so obviously more experimentation is needed.


In any case, your suggestion has got me on the next step, so thanks for 
that tip. I'll add 2 cents to your tab!


--
Dave M G

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