Re: [RFC] Unicode Text Processing

From: Date: Fri, 16 Dec 2022 15:21:46 +0000
Subject: Re: [RFC] Unicode Text Processing
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-119175@lists.php.net to get a copy of this message
Hi On 12/16/22 14:28, Derick Rethans wrote:
Question 2 is that class. I know folks have been clammoring for a String class for some time and this actually fills that niche quite well. A part of me wonders if we can overload it a little to provide a psuedo locale of "binary" so that users can, optionally, treat it like a more generalized String class in specific cases, storing a normal char* zend_string under the hood in that case. Possibly as a specialzation tree.
An alternative could be to just have this as an implementation detail, in case the associated locale/collation is C/root. Then nobody needs to worry about it, *but* it would mean implementing everything twice. Which I am not too keen on, especially because we have such a wide array of operations on strings already.
I rather not see this either, because if a 'Text' object may contain binary data, the type safety is lost and users cannot rely on "'Text' implies valid UTF-8" (see sibling thread). Best regards Tim Düsterhus

« previous php.internals (#119175) next »