[Development] QUtf8String{, View}

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Sat May 16 21:54:33 CEST 2020


On 5/16/20 6:16 PM, Thiago Macieira wrote:
> That opens a philosophical question. In:
> 
>      QString s = u"a a\u0301"; // U+0301 COMBINING ACUTE ACCENT
>      s.replace('a', 'b');
> 
> Should we now have a b with accent? (b́)

It's not philosophical at all, it's a defining question: at which level 
does QString operate? It does not operate at the EGC level, it operates 
at the UTF-16 level. (Proof: s.size() above is 4). Hence, the replace() 
above is merely replacing 0x0061 with 0x0062 in the char16_t-like storage.

My 2 c,
-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4329 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.qt-project.org/pipermail/development/attachments/20200516/1176f50b/attachment.bin>


More information about the Development mailing list