[Development] HEADS-UP: QStringLiteral

Ville Voutilainen ville.voutilainen at gmail.com
Fri Aug 23 08:44:02 CEST 2019


On Fri, 23 Aug 2019 at 09:02, Lars Knoll <lars.knoll at qt.io> wrote:
>
> > On 22 Aug 2019, at 23:43, Ville Voutilainen <ville.voutilainen at gmail.com> wrote:
> >
> >> In any case, we could advocate for utf8 being the input encoding when writing Qt based code/projects or even make it the default. I wanted to do that for Qt 5.0, but we couldn’t because MSVC didn’t support it at that time. It does now however.
> >
> > I must wonder.. are the benefits of that really that useful? I suppose
> > it's nice that you can just write utf-8 in your plain literals, but I
> > wonder why
> > a u"literal" is overly burdensome.
>
> This doesn’t solve the problem that you’re having when you want to use anything outside the ascii range inside “literal”, as the encoding of the source code on disk is not defined. u”…” or u8”…” defines the output encoding (utf16 or utf8), but with the input encoding being undefined, that is not helpful at all for writing portable code.

Ack. Well, we can vote with our feet, and say that in Qt's realm the
input encoding is expected to be utf-8.



More information about the Development mailing list