Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126905 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 qa.php.net (Postfix) with ESMTPS id A23011A00BC for ; Sat, 22 Mar 2025 13:43:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1742650859; bh=tI5J8sfppulx8VyJHWL/P1AvOG7pb7xVT2SP2yfuNM8=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=kiRoB7Qr1EQtmMcctj2OXJaIIYWALSrFNHvXPen3b9sM0XEO23cH1Lu+AxuyKIIqY gj+01rTBEts/YcmvU8Ww9QBLATUX8OxFn7HvIYx2DZ1i6W8Uktjk/yiXPisivr7Ql+ g/Xl8mtwD/hM9PcOVL4lPt/61G7vvgmTDf2PxO8Yn7lLI/hgzzsmvFbw0JfEXAN41V HubQ1F6qh8uqY5fMD40zQS1070nh+eb50HPkrNdfLuggxePOkGp3TxHyarILIpZRqg 5EZQtNUSZUlJ8vMGrdKuneiYWEKY0RQo4kqGiEfAQztBBNS7bRFEu0hvWSjTEQlqv4 16XvYMqVnYMJg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7DB97180068 for ; Sat, 22 Mar 2025 13:40:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from premium76-5.web-hosting.com (premium76-5.web-hosting.com [162.213.255.108]) (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 ; Sat, 22 Mar 2025 13:40:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pmjones.io; s=default; h=To:References:Message-Id:Content-Transfer-Encoding:Cc:Date: In-Reply-To:From:Subject:Mime-Version:Content-Type:Sender:Reply-To:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe :List-Post:List-Owner:List-Archive; bh=tI5J8sfppulx8VyJHWL/P1AvOG7pb7xVT2SP2yfuNM8=; b=a45IsFzTRxVQXPQv2x8shf3MMp 74W7W4t2pRX1e+/j4KgG3xw1tF/BANUgERMKAXt660QNN3nSqreKmu0fuzfQcHAphGYKfQUqWs3h8 JOsaGqF8WjvvgQ/8wVZ9lvNM6lS34+0q1PkvHbB73w2w/8UN6Tp2Kg37nTISw12Y2fdC/f1PdlUMg YSuIV7n4xCC9cL1FvwMgCY24kX8NFlV6Qib6dCx6a6FcAuB7IENycX1vXLsscJ3dPCx381rOIJjqk AtJh5GoBLUBoFgDvH1GbTQqThxR3sscxVA14PnrA43Nz1yUhVh1WGVlVmwDzTB1JUi9mqv5hAdTAL tUtErJBA==; Received: from 107-223-28-39.lightspeed.nsvltn.sbcglobal.net ([107.223.28.39]:52044 helo=smtpclient.apple) by premium76.web-hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1tvz8G-0000000FDJS-3IrA; Sat, 22 Mar 2025 09:43:23 -0400 Content-Type: text/plain; charset=utf-8 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.131.1.6\)) Subject: Re: [PHP-DEV] Potential RFC: mb_rawurlencode() ? In-Reply-To: Date: Sat, 22 Mar 2025 08:43:11 -0500 Cc: PHP Internals List Content-Transfer-Encoding: quoted-printable Message-ID: <4BDB76B7-1EBE-4063-BD88-3B0750D07E67@pmjones.io> References: To: =?utf-8?Q?Tim_D=C3=BCsterhus?= X-Mailer: Apple Mail (2.3826.400.131.1.6) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - premium76.web-hosting.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - pmjones.io X-Get-Message-Sender-Via: premium76.web-hosting.com: authenticated_id: pmjones@pmjones.io X-Authenticated-Sender: premium76.web-hosting.com: pmjones@pmjones.io X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched From: pmjones@pmjones.io ("Paul M. Jones") Hi Tim & all, > On Mar 21, 2025, at 06:22, Tim D=C3=BCsterhus = wrote: >=20 > Am 2025-03-18 18:48, schrieb Paul M. Jones: >> $iriPath =3D '/heads/' . rawurlencode($val) . '/tails/'); >> assert($iriPath =3D=3D=3D '/heads/f=C3=BC bar/tails/'; // false >=20 > =46rom my reading of RFC 3987 that result is incorrect. The space is = neither listed as `iunreserved`, not as `sub-delims`, thus isn't a valid = `ipchar`. Thus the space needs to be encoded as %20 for IRIs as well. = The same mistake applies to the reference userland implementation below. Agreed; the naive implementation would need to less naive and pay closer = attention to the ABNF for `ucschar` and `ipchar` in the spec. Along those lines, I think there might need to be two additional = changes/additions to help with encoding for RFC 3987 and WHATWG-URL = component values: - `http_build_query()` would need PHP_QUERY_3987 and PHP_QUERY_WHATWG = flags and corresponding logic (or entirely new functions); and - `parse_str()` would need a corresponding `mb_parse_str()`. -- pmj