hi
The QChar doc saysBut it seems a single character is stored as one byte.Quote:
The QChar class provides a 16-bit Unicode character.
I had expected the size to be 2 bytes.
Printable View
hi
The QChar doc saysBut it seems a single character is stored as one byte.Quote:
The QChar class provides a 16-bit Unicode character.
I had expected the size to be 2 bytes.
From QString::toAscii:
Quote:
Returns an 8-bit ASCII representation of the string as a QByteArray.
i have already used it in example of first post.
I mentioned it to explain why size() returns 1.
QString::toAscii() returns the 8-bit ascii representation of the character.
So takes your 2-byte Unicode character and returns the 1-byte ascii version of it, hence arr.size() gives 1.
where is the other byte.Quote:
takes your 2-byte Unicode character and returns the 1-byte ascii version of it