Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126890 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 A2DE81A00BC for ; Fri, 21 Mar 2025 11:17:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1742555708; bh=xMllcD7U+FCCoZg9GdrJ12yTSu3hh34THIjmrobYgrI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=k9YwRnw8HTyekJtaRaLfhwKeMmHlHD50HtXhW9Si1QG6uBgMepE3qRpCmVBQPdW1N cA7qci1+rK5J71vQhmzx4tTMjOW8ZIN5cOeRfoiS0YcxkEJf6o5W8NweHQtmF8GX17 99tZ3WxFKfjKbwJEMeyC8q4+BJX3AOdRLoAOEwaswlO6tVVyO9T6wAR9QkSAujHA/R 8W1gXUfUa5Dv82WASixd61PfATf18rO1Gk/zLfMxvvUcLsdhCc1yYDRSjBQUOxhM/9 fX6wN2skRF9bsA1IjGRp+xApk2z4eFBhT6IwvIkTXwbp+/1Z4SXm0qW9tjr0Y94LQ2 jZlnHb/zAGArw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4E285180537 for ; Fri, 21 Mar 2025 11:15:07 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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 ; Fri, 21 Mar 2025 11:15:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1742555852; bh=KV6TcsmfCf4bVh2av5myFRpj74ee4r3JM1tVQ6zNaGA=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=em/1Aa7MsGMW3HuietdAbhjR1L5RjSSNAUuYlvWF9r/FeYOEf4OZCVRMw2e6M6udd T3ulRssNwEg3mh+kmMPnj8Euzwmod7+vt3m2Qadn0YSndiNqbMq1Wrt/ctgLZ660k0 H1MM+5Le+ZyOfbkQl9Zx3y1dwzf+wBv8gK01BFStCyiZ/aC/1i5X0CkACSvw0LQRAk EuHaP9II6k2aQBLxuUDzaV+7ZFwfvVKAQWMhBRjy7CW/M2rxtw2Va/hPA+4LKW2YtE 9JlJ4Ocjr4/D2bOuFAolvuC5FRcHaNgtKN1eyCXbrRcXsnSt+O18dDDlAvsKb9sm/6 wF/U45Rld48tQ== Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Fri, 21 Mar 2025 12:17:32 +0100 To: "Paul M. Jones" Cc: youkidearitai , php internals Subject: Re: [PHP-DEV] Potential RFC: mb_rawurlencode() ? In-Reply-To: References: Message-ID: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2025-03-20 17:46, schrieb Paul M. Jones: >> ```php >> function mb_rawurlencode(string $string, string $encode): string {} >> ``` > > Ah yes, you're right -- probably `?string $encode = null` to match with > mb_substr(). I am not sure if that signature makes sense and if the proposed functionality fits into mbstring for that reason. IRIs are defined as UTF-8, any other encoding results in invalid output / results that are not interoperable. As one example paragraph from RFC 3987: > Conversions from URIs to IRIs MUST NOT use any character encoding > other than UTF-8 in steps 3 and 4, even if it might be possible to > guess from the context that another character encoding than UTF-8 was > used in the URI. The correct solution to me is to build a proper thought-through API as part of the proposed new Uri namespace and not adding new standalone functions without a clear vision. Best regards Tim Düsterhus