[Development] RFC: Proposal for a semi-radical change in Qt APIs taking strings

Bubke Marco Marco.Bubke at theqtcompany.com
Wed Oct 14 22:52:12 CEST 2015


On October 14, 2015 22:13:11 Thiago Macieira <thiago.macieira at intel.com> wrote:

> On Wednesday 14 October 2015 17:55:34 Bubke Marco wrote:
>> Think about a local aware compare which is called very very often. You don't
>> want malloc in between. In in most cases you get an const char* or const
>> shor* in this cases It would be nice if your interface would support UTF-8
>> and not only UTF-16.
>
> Three of the four implementations of QString::localeAwareCompare operate on 
> UTF-16 (Win32 CompareStringW, CoreFoundation's CFStringCompare and ICU 
> ucol_strcoll). That's another reason for keeping QString as UTF-16.
>

Thiago, to my understanding ICU is supporting UTF 8 too. I don't ask for UTF 8 support because I like it but I need it. And I don't want an utf 8 baked QString. For my use cases implicit sharing is overkill.  Move semantics would be enough. I want localAwareCompare(const char *s1, const char *s2). Maybe windows and mac os will bring support to the standard library so we don't need it but in the mean time it would be very helpful. 

A utf 8 based QTextDocument would be maybe nice too. 





More information about the Development mailing list