[Development] QStringLiteral is broken(ish) on MSVC (compiler bug?)

Thiago Macieira thiago.macieira at intel.com
Fri Mar 15 16:20:52 CET 2019


On Friday, 15 March 2019 05:27:09 PDT Giuseppe D'Angelo via Development wrote:
> The mapping of \u escape sequences to the execution character set
> happens before string literal concatenation (translation phases 5/6).
> But AFAIU the mapping is purely symbolic, and has nothing to do with any
> actual encoding, so MSVC is at fault here?

The people from the SG16 in the committee think it is and are preparing a 
paper to clarify. They came to the same conclusion regarding the steps the 
compiler performed as you did, but those steps still lead to an absurd result. 
Why in the world would anyone want the UTF-16 representation of the UTF-8 
encoding of something?

The point is that the compiler had 0xC4 0x82, knew it was UTF-8 and was being 
asked to provide an UTF-16 representation. It should have performed a UTF-8-
to-UTF-16 transformation, not CP1252-to-UTF-8 one.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products






More information about the Development mailing list