[Development] std::format support for Qt string types
Thiago Macieira
thiago.macieira at intel.com
Thu Jun 6 17:52:14 CEST 2024
On Thursday 6 June 2024 08:07:31 GMT-7 Giuseppe D'Angelo via Development
wrote:
> Again, I'm not really sure of entangling consoles with this.
> If you go for this approach and std::print a QString on Windows, what
> kind of output do you get?
Garbage.
Terminal-printing on Windows is fatally broken unless the Windows application
opts in to UTF-8 support. That's the application, not a library.
The problem with terminals on Windows is that they use the even older DOS
codepage, not the legacy Windows 8-bit CP_ACP codepage. We do not support the
DOS codepage in Qt at all.
qDebug() << u"\u00e4";
printf("\xe4\n");
On a standard Windows, the first line will print the same as the second: byte
0xE4. But instead of the LATIN SMALL LETTER A WITH DIAERESIS, you'll see a
sigma symbol.
Therefore, please ignore terminal printing on Windows until UTF-8 is deployed
there. Which means we can assume terminals are always UTF-8 too.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Principal Engineer - Intel DCAI Fleet Engineering and Quality
-------------- 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/20240606/3052287a/attachment.bin>
More information about the Development
mailing list