Re: Potential RFC: mb_rawurlencode() ?

From: Date: Fri, 21 Mar 2025 11:17:32 +0000
Subject: Re: Potential RFC: mb_rawurlencode() ?
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi

Am 2025-03-20 17:46, schrieb Paul M. Jones:
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

Thread (6 messages)

« previous php.internals (#126890) next »