Re: json_encode() behavior for incorrectly encoded strings
| From: | Daniel Convissor | Date: | Sun, 24 Jun 2012 13:01:38 +0000 |
| Subject: | Re: json_encode() behavior for incorrectly encoded strings | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-60956@lists.php.net to get a copy of this message | ||
Hola:
On Sat, Jun 23, 2012 at 06:03:34PM -0700, Rasmus Lerdorf wrote:
> And yes, I don't think a warning from json_encode() is useful because to
> properly avoid it you would need an iconv() call before calling it and
> that is pure overhead. Short of that your only recourse is to use @ and
> that just isn't the right answer. In this I would suggest just having it
> return false and have json_last_error() apply to json_encode() as well.
+1
--Dan