Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34995 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70733 invoked by uid 1010); 29 Jan 2008 05:46:02 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 70717 invoked from network); 29 Jan 2008 05:46:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2008 05:46:02 -0000 Authentication-Results: pb1.pair.com header.from=tokul@users.sourceforge.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=tokul@users.sourceforge.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain users.sourceforge.net from 213.197.162.99 cause and error) X-PHP-List-Original-Sender: tokul@users.sourceforge.net X-Host-Fingerprint: 213.197.162.99 avilys.eik.lt Linux 2.6 Received: from [213.197.162.99] ([213.197.162.99:36608] helo=avilys.eik.lt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/78-25507-89DBE974 for ; Tue, 29 Jan 2008 00:46:01 -0500 Received: from avilys.eik.lt (avilys.local [127.0.0.1]) by avilys.eik.lt (Postfix) with ESMTP id 290EDBEEA for ; Tue, 29 Jan 2008 07:42:43 +0200 (EET) Received: from avilys.eik.lt (avilys.local [127.0.0.1]) by avilys.eik.lt (Postfix) with ESMTP id 0FDD0BEE9 for ; Tue, 29 Jan 2008 07:42:43 +0200 (EET) Received: from 78.61.224.253 (NaSMail authenticated user tomas@topolis.lt) by avilys.eik.lt with HTTP; Tue, 29 Jan 2008 07:42:43 +0200 (EET) Message-ID: <51526.78.61.224.253.1201585363.nsm@avilys.eik.lt> In-Reply-To: <479EB7ED.8070606@lerdorf.com> References: <200801241426.39756.arnaud.lb@gmail.com> <479A613C.8030604@zend.com> <3hpsp3hmn2de4fard8lkpentg24k70jrhg@4ax.com> <479E80D8.5020206@lerdorf.com> <479EB7ED.8070606@lerdorf.com> Date: Tue, 29 Jan 2008 07:42:43 +0200 (EET) To: internals@lists.php.net User-Agent: NaSMail/1.4 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [PHP-DEV] [PATCH] Bug #43896 htmlspecialchars returns empty stringoninvalid unicode sequence From: tokul@users.sourceforge.net ("Tomas Kuliavas") > That part is completely different. That's at the display level. > Replacing it in the backend makes no sense to me. Don't use > utf8_decode. Use iconv() so you know what the heck is going on. :) iconv() will stop on conversion error and return partial string or empty string. It will require even more complex code than 5.2.5 htmlspecialchars() does. With htmlspecialchars you check for empty string before and after the call. With iconv you check for php errors during iconv call. -- Tomas