[Development] HEADS-UP: QStringLiteral

Mutz, Marc marc at kdab.com
Fri Aug 23 08:14:10 CEST 2019


On 2019-08-22 23:43, Ville Voutilainen wrote:
> I have
> always wanted to maximize
> the amount of people who can read my source code, and that means
> emojis are out. :)

I don't believe European languages as written by you and me are the 
benchmark here. Asian locales (incl. Russian/Cyrillic) are. It may be 
acceptable to use \x or \0 to escape the odd non-ascii character in 
European languages using Latin script, but decidedly not for Russian or 
even Chinese. And while one could argue that the design language should 
be English and the native locale added using the normal i18n toolchain, 
that's surely not what happens in German programming shops, and I don't 
expect it to be different in Russian or Chinese ones, either.

So, yes, with C++20, we can ask people to use u8"" (after we fixed Qt's 
support for it), but for the last two-and-a-half decades, that hasn't 
been an option, thus const char* == utf-8 is a reasonable stop-gap 
measure, IMHO.

Whether that leads us in a direction where Qt 8 defines const char* as 
US-ASCII is anyone's guess. More likely, we'll just stop supporting char 
and require explicit charN_t.

Thanks,
Marc



More information about the Development mailing list