Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116216 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 25189 invoked from network); 4 Oct 2021 14:14:23 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Oct 2021 14:14:23 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 115BF1804C5 for ; Mon, 4 Oct 2021 07:58:35 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_HOTMAIL_RCVD2, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8075 40.80.0.0/12 X-Spam-Virus: No X-Envelope-From: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-oln040092072049.outbound.protection.outlook.com [40.92.72.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 4 Oct 2021 07:58:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A5DW/syjXpVEE5VpVH8JReTd4bVR8mFWALSZvgqaV1wD9yvb3OjOHUYBYcKyOkmflIoEI2bXNSAQkEtGl8zu59qE0jPHUvVfl3wUWWr8ZpfC5xhy5+q2oFxLPy4vh/ZBkm8uNu8pvM6jbRGbZJ2xyKR/nCt5zkZoVtcyBZExrueIEOoOMZ8PjoUQFtixMr4QA+ZaWESk9st9PVargRmXTNdVP9Ph13VlUAWVyZVrMfXB3dt33qUJmiiE0ZUdN32HARcD/k6CPqnrbY76608U5HzfqOlZhh0ZqA82rJAkorQFJg1jDhaxmlboj43OBQgmH7ZF9/T58C3IGM+jPaOkFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=z/vPBg+fEZJDwGldB9xOySN1Bn6Z0/uMOIRQFjkSoYE=; b=mzQ52U5iWUGggm/pVjtCV8fWx3rOKcOcb6v1bmc2ucqeRJx1JFgKasGWhwunyodinyKOuje8pZZHcx1vauSv9vFTrMjZu0C/8jD/tCVxtzqPtIksneyXUdbFX2apuo8Gj3hTC6WdSdUsYQ61LhtFsE1efYD2qd8oKnJVhRz3IIdFb9xfUpk5/SAB45O+juZz0Wu+F9Li8PRHnu9K+wnbaZVaoAuLWjvlHi29dLSBOCYWsozTzAd/Fk+En4ma9F2GDw3P0HUmtmWi0vLcyXGaShLU7amzgX6NYE1OZEWUaEIbKpUHgiiNSkjQYOlxUpOsS8Hl7kMq4zJY9CrJ5a2vzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z/vPBg+fEZJDwGldB9xOySN1Bn6Z0/uMOIRQFjkSoYE=; b=uWmtQgNRobU9Ji/pj8QiuCH5VoLs+XQSmDQCJHe0Da3CloQKqgFbYMvpKX7roe8O88QEFRk8pJ0rtR5trG3kwi+AI/vAHTwOu61ANP2oIlSJ73aYvlpUseQpb59rP+DhgSl3eiN3Vt84sqBW4CcfNYQu7XY0pO9gx9amfLOIeZzeldK0zVv6MEMsA+bOGPR4Qm0t+rVvqURRnFo6bC5tuh8R5SgDHH3dJKTjK3lBH1mBbGkT20pwabwe6NX8LCvm1bwswz/K2qcMsbOCgHqmbHUxEufNeiwtBqFPWFZPt5A5lxy7GBZ992zFBbvRfrsS193JuoC94HmDoWqtmXC63w== Received: from PR3PR09MB5233.eurprd09.prod.outlook.com (2603:10a6:102:14c::7) by PR3PR09MB5316.eurprd09.prod.outlook.com (2603:10a6:102:177::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.15; Mon, 4 Oct 2021 14:58:29 +0000 Received: from PR3PR09MB5233.eurprd09.prod.outlook.com ([fe80::fc85:f13c:303d:d68e]) by PR3PR09MB5233.eurprd09.prod.outlook.com ([fe80::fc85:f13c:303d:d68e%9]) with mapi id 15.20.4478.028; Mon, 4 Oct 2021 14:58:29 +0000 Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_CC0E4CE9-F840-4765-B54A-BA4EA3A89DDE" Date: Mon, 4 Oct 2021 17:01:25 +0200 In-Reply-To: Cc: PHP internals To: Nikita Popov , Tim Starling References: X-Mailer: Apple Mail (2.3445.104.11) X-TMN: [QRswBAujECypdO99CqgVVUKwtbSp6oVcTy83mCPsFTeFgPwxNOE3bAXlLam6wnZb] X-ClientProxiedBy: PR0P264CA0284.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1::32) To PR3PR09MB5233.eurprd09.prod.outlook.com (2603:10a6:102:14c::7) X-Microsoft-Original-Message-ID: <4F149ADA-A9EF-4A13-949C-5A15D51BE38E@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [IPv6:2001:7e8:cbc2:f400:a949:3969:69ea:fab1] (2001:7e8:cbc2:f400:a949:3969:69ea:fab1) by PR0P264CA0284.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.13 via Frontend Transport; Mon, 4 Oct 2021 14:58:26 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 02a88642-2a63-49a6-0f94-08d987476b9e X-MS-TrafficTypeDiagnostic: PR3PR09MB5316: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yy66LW5RlwYdLF2gqbkZ+nmFGKhGxty2D64Daitt+YEjPBaB93WFB8SuZY6oCY7iPq8CQCU3zPzn6dxAK74XwcT6GNvSIu1gv7t5UyIPF5DPgLY9teU4vC2Fv6qSUraUkMm/1ksjnqR4d7ES6DESV4py7vK92uQMkVJRt06oztFcbbPqAg5cpbe1Cu4JJd1dEzm49WZjeSzr3GXbMNabmaSbVrln56VXGlHfFyUw6SE/QQKHV2aC+objnewiM9fEk+xWgV+BSkJzJLRd3heP2X3uriaKw46o6R4ZOSrgs+nKkd04PUQTyFwaW7SZOiylHhjSRryYufpjr3E4YTVEhv2q+Q5BXlHDwJCqXSMrkpbTC4I+KVw57Gz8KiRpYzzUx/rcnQgO7syORTam+S2U7Eyt4yAG191rx1VhFQPYw8C+9rFNPz+8DAeX3PLE7/bYRjy7daYBJs8FL9aF0AioZkIH0drupoeEP6EbbZoFUy8= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hCIil/9nKj6KJnAq1NeXOj+g79mJpzBwFEAwauuszkRgFCrSfpyKvEcs2FvBjt2/+vGMm1EqNra8Y/Xg8SkUsZeRcy8wgdBAObZsSrCItWD60TXju347df3Cm5SDIKGaXpuvA+DWNENKh1eHBqOtQCi7zu9NvHvGHaSNSVSiEKUTTPFsy3CyGi8pz40YjlkFs1wmo0XHj6CghrN9f4tSRw== X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-72e6e.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 02a88642-2a63-49a6-0f94-08d987476b9e X-MS-Exchange-CrossTenant-AuthSource: PR3PR09MB5233.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2021 14:58:29.0304 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR09MB5316 Subject: Re: [PHP-DEV] [RFC] Locale-independent case conversion From: bobwei9@hotmail.com (Bob Weinand) --Apple-Mail=_CC0E4CE9-F840-4765-B54A-BA4EA3A89DDE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > Am 04.10.2021 um 12:08 schrieb Nikita Popov : >=20 > On Thu, Sep 23, 2021 at 8:32 AM Tim Starling > > wrote: >=20 >> Please consider my RFC for locale-independent case conversion. >>=20 >> https://wiki.php.net/rfc/strtolower-ascii >> https://github.com/php/php-src/pull/7506 >>=20 >> The RFC and associated PR ended up going some way beyond the original >> scope, because for consistency, it's best if everything has the same >> concept of case folding. I saw this as an opportunity to clean up a >> common kind of locale-dependence in PHP which was previously = inconsistent. >>=20 >> So not only will strtolower() and strtoupper() become >> locale-independent, converting only ASCII, but also stristr, stripos, >> strripos, lcfirst, ucfirst, ucwords, str_ireplace, the array sorting >> functions with SORT_FLAG_CASE, and array_change_key_case. >>=20 >> Also, I changed a number of internal functions to use ASCII case >> folding, giving rise to a range of effects in callers throughout the >> core tree. The effects are all documented in the RFC. >>=20 >> I am proposing that locale-sensitive case conversion be provided with >> the new names ctype_tolower() and ctype_toupper(). Those names might >> seem odd at first glance, but they are wrappers for functions in >> ctype.h and work in a very similar way to the rest of the ctype = extension. >>=20 >=20 > Hi Tim, >=20 > Thanks for creating this proposal, it looks great! >=20 > I think this is a very beneficial change, and the amount of incorrect > locale-dependent calls we had just in php-src further convinced me of = this: > We're generally aware of the problem, and we still made this mistake. = Many > times. I definitely agree that it's good to make these functions = locale-insentive. > The only open question I have is regarding the ctype_* functions. One = might > argue that these functions should be locale-independent as well. = Certainly, > whenever I have used ctype_digit() I only intended it to match [0-9]. = It > seems like some people try to use ctype_alpha() in a locale-sensitive = way ( > = https://stackoverflow.com/questions/19929965/php-setlocale-not-working-for= -ctype-alpha-check = ) > and then fail because it doesn't support UTF-8. On that topic, do we also want to add mb_ucfrist, mb_lcfirst and = mb_ucwords? Then you have also proper local independent functions handling these use = cases. This is only tangentially related to the current RFC, so feel free to = ignore this. Bob= --Apple-Mail=_CC0E4CE9-F840-4765-B54A-BA4EA3A89DDE--