Re: [Discussion] Should All String Functions Become Multi-Byte Safe?

From: Date: Mon, 12 Aug 2024 03:30:14 +0000
Subject: Re: [Discussion] Should All String Functions Become Multi-Byte Safe?
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-124880@lists.php.net to get a copy of this message
On 12/08/2024 00:36, Nick Lockheart wrote:
So what I would propose is: (1) All string functions should state in the official man page if they are safe for UTF-8 or not.
Reasonable but see below
(2) Functions intended for working with text should be made UTF-8 safe.
Define precisely UTF-8 safe. Also, what about BC breaks here?
(3) Functions intended for processing binary should be added if necessary, and should be named something like "binary" or "byte".
That would require renaming and deprecating most of the standard string library, I guess no one would agree to that. But generally they are already named differently, str* are binary, mb_* and grapheme_* are text-oriented

« previous php.internals (#124880) next »