Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36185 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56869 invoked from network); 18 Mar 2008 03:51:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Mar 2008 03:51:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=stephen@stephenbach.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=stephen@stephenbach.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain stephenbach.net from 141.161.88.35 cause and error) X-PHP-List-Original-Sender: stephen@stephenbach.net X-Host-Fingerprint: 141.161.88.35 uis-ironport-4.georgetown.edu Received: from [141.161.88.35] ([141.161.88.35:16885] helo=uis-ironport-4.georgetown.edu) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 54/C7-07136-E3C3FD74 for ; Mon, 17 Mar 2008 22:51:27 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuUEAMfY3keNoVjX/2dsb2JhbACSCZZpgg8 Received: from postoffice-3.georgetown.edu (HELO uis-gumail-8-stage2.georgetown.edu) ([141.161.88.215]) by uis-ironport-4.georgetown.edu with ESMTP/TLS/DHE-RSA-AES256-SHA; 17 Mar 2008 23:51:24 -0400 Received: from uis-gumail-8.georgetown.edu (postoffice-3.georgetown.edu [141.161.88.215]) by uis-gumail-8-stage2.georgetown.edu (8.13.6/8.12.10) with ESMTP id m2I3pJAe028510 for ; Mon, 17 Mar 2008 23:51:19 -0400 (EDT) Received: from wkstn35-53.swq.georgetown.edu (wkstn35-53.swq.georgetown.edu [141.161.35.53]) (user=shb24 mech=PLAIN bits=0) by uis-gumail-8.georgetown.edu (8.13.6/8.12.10) with ESMTP id m2I3pD2A028503 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 17 Mar 2008 23:51:14 -0400 (EDT) To: internals@lists.php.net Date: Mon, 17 Mar 2008 23:51:12 -0400 User-Agent: KMail/1.9.6 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_wwz3HR3mBxB69Ag" Message-ID: <200803172351.12440.stephen@stephenbach.net> X-GU-FilterVersion: 1.29 X-Scanned-By: MIMEDefang 2.39 Subject: [PATCH] Bug 43477 - Unicode error mode ignored From: stephen@stephenbach.net (Stephen Bach) --Boundary-00=_wwz3HR3mBxB69Ag Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Attached is a simple proposed patch that fixes Bug 43477. Basically, the code that set the error mode of the ICU converter was giving it an instruction (the context parameter) to only skip or substitute if the code point was not represented in the new encoding. However, it still was returning an error for illegal sequences. The test suite returns the same results with or without the patch. Test also attached. -Stephen Bach --Boundary-00=_wwz3HR3mBxB69Ag Content-Type: text/x-diff; charset="utf-8"; name="bug43477.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bug43477.patch" Index: Zend/zend_unicode.c =================================================================== RCS file: /repository/ZendEngine2/zend_unicode.c,v retrieving revision 1.37 diff -u -r1.37 zend_unicode.c --- Zend/zend_unicode.c 31 Dec 2007 07:12:07 -0000 1.37 +++ Zend/zend_unicode.c 15 Mar 2008 23:37:36 -0000 @@ -47,16 +47,16 @@ case ZEND_CONV_ERROR_SKIP: if (direction == ZEND_FROM_UNICODE) - ucnv_setFromUCallBack(conv, UCNV_FROM_U_CALLBACK_SKIP, UCNV_SKIP_STOP_ON_ILLEGAL, NULL, NULL, &status); + ucnv_setFromUCallBack(conv, UCNV_FROM_U_CALLBACK_SKIP, NULL, NULL, NULL, &status); else - ucnv_setToUCallBack(conv, UCNV_TO_U_CALLBACK_SKIP, UCNV_SKIP_STOP_ON_ILLEGAL, NULL, NULL, &status); + ucnv_setToUCallBack(conv, UCNV_TO_U_CALLBACK_SKIP, NULL, NULL, NULL, &status); break; case ZEND_CONV_ERROR_SUBST: if (direction == ZEND_FROM_UNICODE) - ucnv_setFromUCallBack(conv, UCNV_FROM_U_CALLBACK_SUBSTITUTE, UCNV_SUB_STOP_ON_ILLEGAL, NULL, NULL, &status); + ucnv_setFromUCallBack(conv, UCNV_FROM_U_CALLBACK_SUBSTITUTE, NULL, NULL, NULL, &status); else - ucnv_setToUCallBack(conv, UCNV_TO_U_CALLBACK_SUBSTITUTE, UCNV_SUB_STOP_ON_ILLEGAL, NULL, NULL, &status); + ucnv_setToUCallBack(conv, UCNV_TO_U_CALLBACK_SUBSTITUTE, NULL, NULL, NULL, &status); break; case ZEND_CONV_ERROR_ESCAPE_UNICODE: --Boundary-00=_wwz3HR3mBxB69Ag Content-Type: text/plain; charset="utf-8"; name="bug43477.phpt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bug43477.phpt" --TEST-- Bug #43477 (Unicode error mode) --FILE-- --EXPECT-- unicode(0) "" --Boundary-00=_wwz3HR3mBxB69Ag--