Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127610 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id B8C431A00BC for ; Thu, 5 Jun 2025 14:35:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1749134002; bh=RvUe673kGEz9Xtb3Dj1Os6u4QewEs0PuSC84MsryjQo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=TK2aU6LyEbhNI0IPAzZeYd5u6hIM/2/4qSZbz8fBbAKdMlPQ/F0lJgjqdII/SOIqQ a3gdP4T76NpBn/idVeX80rq6ctMlMI54WXxoIbBBsBc/lh4UcCfa9j6Y/k7e79QmVU 1GruMWKqGcHzQmEojdnbb1gGkkncJtuf6EUlDbPfoaWmij6gxYTTcyC+rycZ43KQj2 IOHZMKBp3wfIWzN74DT+W7BPrw8AphCLoxv/JsjcfoWSH05c7tQ2JpIXD5CqlxMLc0 IqweYNq4tvDU7oBG4t/kvA+SpLe4zZN91QQvhsSXYZhjsNu0KOH3Z17o/qXt7yByec h/g1C+wcSVIQg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5C44B18002F for ; Thu, 5 Jun 2025 14:33:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 5 Jun 2025 14:33:11 +0000 (UTC) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-451d54214adso8990885e9.3 for ; Thu, 05 Jun 2025 07:35:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749134113; x=1749738913; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=2qY9nqcD/xsaRv9YS+9qXLm/MnQUuqhJeF6a1V6uctg=; b=CRpyNKNQJ3FP3Zm6TSvFgs6l/D/pf7bG52q+7py9nJhdc4BJgYmF2LZxX/9XUe/uJQ tlwGgXi8Jfb/IUDLIgCkzF2quNQn6jXEQKGXV6Q6B6v6mXotgdqTtrW8bTgCpB2fY7lk YwzsBnx5xUNbQIVKyOI6TNLVz32TcLbbMlykjGMe15fJheJ3dSMekx9Qh6s2NJuWsO5S xgBiT1fxbJUvvZ8S4kf2wXQlLbiztJ4St3UOw/NeUGl0yvgnXxt2AxO9UfBWMHBGOuBE 7diKRuk3xajKLDjLL2sgHB0QnOrmk8cvK2DulEWs8+32Ecif2h4iHYBTvQPmFFKjAwdi 0x0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749134113; x=1749738913; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2qY9nqcD/xsaRv9YS+9qXLm/MnQUuqhJeF6a1V6uctg=; b=KtaHtKRkzLNDtrpgBPqr01szd4AuvGRMYy456CTGhMOZM9o79PyOILvF579qV5r5Fk 6W6BeK3fjnRTUHoEVs3Xd1NRmAS44jZcxvu0b9ltSYRRm8ynHTEqGXaWZR3fmv1bK8/i UalHb/IYlki49h1nn3/2uKIreHBkgWr9p5iEuv1MFvNKFG6hNWutViJtXlICEFY1NuwO OXFPOyAhRp6EzFXcWb/FUA/9FqYJYdnFGWspmd4DLUVcsxPRqiSXndQDYsqBOpf6KEtm AzXb/nrqppRD4iMmfE9Ke7zAEsuHP5OpBnl2cEXAcOjOQe2kNuwkMApn8rtBtuAbjIh3 pmvw== X-Gm-Message-State: AOJu0Yx16Qy1PlfKhzGfr1FiWhueBUjHIftlnqM0MojTaAQwpSGS7hw6 AslUEhhQ+BukJb2XenccH9v7kPZDvLepX4SXi2FeQVtZEy/UzObc9LWJOY60AAD+khyz7bOHedM 8lnYOP2TfltIHKF1Gc4E4HrrRevGTzVm6kS4l/A== X-Gm-Gg: ASbGnct+pOSUL0beje7OP9UC+mrPzbY1y7UTv67PHEyc0MgtcNZtD0ds3wEuVt/L/EK 78xmPvNcddKKfSATTsLQT0LezR8vGJe9NQJkaMLrrlBXx1Bu8B0OMioRwtFbmInLCj5LZZ30Xty OyddnjOeQ6/uhe3HbAt/QSbMlWC/nsRqQw65M8qURYBau/qbfzkK2mlO5GVAadFFKiRERWeaSBO Hhy3Wb9jw== X-Google-Smtp-Source: AGHT+IGo/ZGsmUIhUvxbCfz0fBWZP/dr406XMg0uZ9F+ae7uvkRgd0ifxzVHrpt3FatMTvuO/bVEqmraDfni4SOIYTQ= X-Received: by 2002:a05:6000:26c1:b0:3a5:1f2:68f3 with SMTP id ffacd0b85a97d-3a51d9664femr5917705f8f.46.1749134113016; Thu, 05 Jun 2025 07:35:13 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 5 Jun 2025 23:35:01 +0900 X-Gm-Features: AX0GCFt2HGJau3cbg9EcklT8yqmPXM9h-TA5SEUtbGqqLGBWI0_JNB1cAcBmn0c Message-ID: Subject: Re: [PHP-DEV][DISCUSSION] grapheme_* functions adds locale in parameter (or any?) To: php internals Cc: Claude Pache Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: youkidearitai@gmail.com (youkidearitai) 2025=E5=B9=B46=E6=9C=885=E6=97=A5(=E6=9C=A8) 18:02 Claude Pache : > > > > > Le 5 juin 2025 =C3=A0 03:04, youkidearitai a = =C3=A9crit : > > > > Hi, Internals > > > > I would like adds locale parameter that already there are grapheme_* fu= nctions. > > Because Unicode is locale-dependency but grapheme_* functions is not > > locale-dependency. > > > > For example, Add $locale parameter is below. > > ``` > > grapheme_extract( > > string $haystack, > > int $size, > > int $type =3D GRAPHEME_EXTR_COUNT, > > int $offset =3D 0, > > int &$next =3D null, > > string ?$locale =3D null > > ): string|false > > grapheme_str_split(string $string, int $length =3D 1, string ?$locale = =3D > > null): array|false > > grapheme_stripos(string $haystack, string $needle, int $offset =3D 0, > > string ?$locale =3D null): int|false > > grapheme_stristr(string $haystack, string $needle, bool $beforeNeedle > > =3D false, string ?$locale =3D null): string|false > > grapheme_strlen(string $string, ?string $locale =3D null): int|false|nu= ll > > grapheme_strpos(string $haystack, string $needle, int $offset =3D 0, > > string ?$locale =3D null): int|false > > grapheme_strripos(string $haystack, string $needle, int $offset =3D 0, > > string ?$locale =3D null): int|false > > grapheme_strrpos(string $haystack, string $needle, int $offset =3D 0, > > string ?$locale =3D null): int|false > > grapheme_strstr(string $haystack, string $needle, bool $beforeNeedle = =3D > > false, ?$locale =3D null): string|false > > grapheme_substr(string $string, int $offset, ?int $length =3D null, > > ?string ?$locale =3D null): string|false > > ``` > > > > What do you think? > > I would like go to write an RFC if this is fine. > > > > Regards > > Yuya > > > > Hi, > > A $locale parameter could be added for functions that are locale-dependan= t: grapheme_stripos() ,grapheme_stristr(), grapheme_strripos(), and more ge= nerally to any function that deals with casing. > > It doesn=E2=80=99t make sense for the other functions. > > =E2=80=94Claude > > Hi, Claude and Internals Thank you for your feedback. Indeed, I keep only locale is case-sensitive. However, I watched that RFC: https://wiki.php.net/rfc/strtolower-ascii and https://github.com/php/php-src/pull/7511, Perhaps, I should not locale-dependant for grapheme functions. I'll think about it more deeply. Please give me a time. Regards Yuya --=20 --------------------------- Yuya Hamada (tekimen) - https://tekitoh-memdhoi.info - https://github.com/youkidearitai -----------------------------