[Development] Outfit based collation (was: RFC: Proposal for a semi-radical change in Qt APIs taking strings)

Knoll Lars Lars.Knoll at theqtcompany.com
Fri Oct 16 12:53:37 CEST 2015


Hi Marco,

On 16/10/15 11:46, "Bubke Marco" <Marco.Bubke at theqtcompany.com> wrote:
>
>>> That is the
>>> power of iterators and with the new features of C++ they get really
>>>useful.
>>> But anyway,  I don't say that we have to change everything. The last
>>>time
>>> we did that we broke our event system which is still not working like
>>>it
>>> was before we introduced QWindow. I think we  should have an
>>>evolutionary
>>> process to  adapt to the  changing environment and not try to reiterate
>>> what was successful in the past.
>>
>> I agree with what you said in this paragraph. But it does not lead to a
>> conclusion about using UTF-8 or even providing our own UTF-8 class.
>>
>
>Introducing an utf 8 class is not that hard but providing the framework
>around. Collations are the problem. We have to use utf8 in QtCreator
>anyway so we could find out what is an useful API.  But colation support
>in Qt would be really helpful in the longer run.

The problem with Collation and utf-8 is that the only API offering utf-8
based collation is ICU (which offers both utf-8 and utf-16 based
collation). Mac and Windows only offer utf-16.

So we’d still need to convert in most cases. It would probably be possible
to do that on the stack for small strings to avoid a malloc though. So we
can discuss adding a QCollator::collateUtf8(const char *s1, int len1,
const char *s2, int len2).

But just out of curiosity, where does Creator need collation in a
performance critical place?

Cheers,
Lars



More information about the Development mailing list