Re: Potential RFC: mb_rawurlencode() ?
| From: | Tim Düsterhus | 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 internals+get-126890@lists.php.net to get a copy of this message | ||
Hi
Am 2025-03-20 17:46, schrieb Paul M. Jones:
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:Ah yes, you're right -- probablyfunction mb_rawurlencode(string $string, string $encode): string {}?string $encode = nullto match with mb_substr().
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