[Development] HEADS-UP: QStringLiteral

Konstantin Tokarev annulen at yandex.ru
Wed Aug 21 17:31:26 CEST 2019



21.08.2019, 18:29, "Tor Arne Vestbø" <tor.arne.vestbo at qt.io>:
>>  On 21 Aug 2019, at 17:24, Konstantin Tokarev <annulen at yandex.ru> wrote:
>>
>>  21.08.2019, 18:22, "Tor Arne Vestbø" <tor.arne.vestbo at qt.io>:
>>>>   On 21 Aug 2019, at 16:55, Thiago Macieira <thiago.macieira at intel.com> wrote:
>>>>
>>>>   On Wednesday, 21 August 2019 07:47:23 PDT Thiago Macieira wrote:
>>>>>   On Wednesday, 21 August 2019 03:01:29 PDT Tor Arne Vestbø wrote:
>>>>>>   This should just be test[“key”] = “value”. How do we get there?
>>>>>
>>>>>   Do you mean "make this the most optimal?" If so, then we don't get there.
>>>>>   It's not possible.
>>>>
>>>>   Oh, the following is nearly the most optimal:
>>>>
>>>>           test[u"key"] = u"value”;
>>>
>>>  So that would be utf16, can’t we let test["key"] = “value” assume utf8, ie u8”foo” without the explicitness?
>>
>>  Conversion of UTF8 to UTF16 costs more, and here we know that literal is ASCII-only.
>
> Sure, okey, I’m happy with “foo” being interpreted as ascii, u8”" as utf8 and u”” as utf16, as long as I can use all of them in other Qt APIs that take a stringish. Ideally with automatic make-it-a-qstring-literal using C++ fanciness over QFooLiteral :)

I would prefer if Qt APIs didn't insist on using QString and could work with sane string encodings

-- 
Regards,
Konstantin



More information about the Development mailing list