![]() |
CopperSpice API
2.0.0
|
C++11 added definitions for char16_t and char32_t. The definition of the data type char8_t was added in C++20. With the addition of this new data type the meaning of the prefix u8 was altered.
A string literal is the formal name for a quoted string. Before C++20 using no prefix before a string literal or using the u8 prefix called the same overloads in QString. The data was considered to be an "array of char elements".
With the release of C++20 the meaning of the u8 prefix changed. The current definition states the data should be treated as an array of char8_t elements.
When creating a new QString if no prefix is specified the encoding of UTF-8 will be assumed.
If the prefix u8 is specified then the encoding is defined and guaranteed to be UTF-8. New overloads where added to QString to handle the different types.
The u and U prefixes were added in C++11 and their definitions have not changed.
Prefix | Data Type | Encoding |
---|---|---|
u8 | char8_t | UTF-8 |
u | char16_t | UTF-16 |
U | char32_t | UTF-32 |