Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35225 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27885 invoked by uid 1010); 6 Feb 2008 08:27:50 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 27869 invoked from network); 6 Feb 2008 08:27:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Feb 2008 08:27:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.94.239.7 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.94.239.7 mail.jdi-ict.nl Linux 2.6 Received: from [82.94.239.7] ([82.94.239.7:57423] helo=mail.jdi-ict.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 66/A9-03555-F7F69A74 for ; Wed, 06 Feb 2008 03:27:46 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.jdi-ict.nl (8.13.7/8.12.11) with ESMTP id m168RYcn002341; Wed, 6 Feb 2008 09:27:34 +0100 Date: Wed, 6 Feb 2008 09:27:34 +0100 (CET) X-X-Sender: derick@kossu.ez.no To: Richard Lynch cc: Stanislav Malyshev , "'PHP Internals'" In-Reply-To: <48527.98.193.37.55.1202249970.squirrel@www.l-i-e.com> Message-ID: References: <479A60BA.7030905@zend.com> <47A66FBF.1040004@zend.com> <48527.98.193.37.55.1202249970.squirrel@www.l-i-e.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=UTF-8 Subject: Re: [PHP-DEV] json_encode() bug From: derick@php.net (Derick Rethans) On Tue, 5 Feb 2008, Richard Lynch wrote: > On Sun, February 3, 2008 7:51 pm, Stanislav Malyshev wrote: > >> Like I mentioned before (I think), it should not return an empty > >> string of course because programmatically it's not possible to > >> check for this. As most of our functions return false in those > >> cases, so should this function. > > > > AFAIR false is not valid JSON, so it would break a lot of code. > > Also, I am not sure we should change json_encode to return false on > > whole structure if one of the fields contains invalid utf-8. [snip] > Put partially decoded value somewhere in a variable to be accessed, so > that the programmer can make an informed decision about what to do. We're talking about encoding here though... regards, Derick -- Derick Rethans http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org