[Development] Are char literals L1 or U8 in Qt?

Thiago Macieira thiago.macieira at intel.com
Mon Jun 10 23:13:59 CEST 2024


On Monday 10 June 2024 05:39:26 GMT-7 Marc Mutz via Development wrote:
> Since there are four bugs³ in QString::arg() that are all fixed by the
> existing patch chain porting the whole thing to QAnyStringView, and
> since the medium-term goal is to deprecate use of char for characters
> and char[] for strings (QT_ASCII_WARN), anyway, I would like to fix
> QASV(char) to mean QASV(QChar(char)), not redefine char literals as
> UTF-8 and break many more users (QASV is relatively new; QChar(char) and
> QString::arg(char) are there since before Qt 4).

I am all for fixing the incompatibility, but I am of the opinion that char-as-
Latin1 was the wrong choice. It was wrong in Qt 4 and is still wrong now. 
My point is that a const char[] is a UTF-8 string, therefore each char in 
there is an UTF-8 code unit.

Anyone iterating character by character across two different encodings probably 
already has bugs.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCAI Fleet Systems Engineering
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5152 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20240610/a4eb78d0/attachment.bin>


More information about the Development mailing list