Details
-
Bug
-
Resolution: Done
-
P4: Low
-
5.1.1
-
None
-
Windows 7 (32-bit)
Description
The documentation for QString::fromWCharArray() says: "If wchar is 4 bytes, the string is interpreted as ucs-4, if wchar is 2 bytes it is interpreted as ucs-2."
The documentation for QString::fromStdWString() says: "The given string is assumed to be encoded in utf16 if the size of wchar_t is 2 bytes (e.g. on windows) and ucs4 if the size of wchar_t is 4 bytes (most Unix systems)."
Since both functions do the same, the documentation should say the same. The documentation for QString::fromWCharArray() is misleading since UCS-2 does not support surrogate characters.
Furthermore, both QString::fromWCharArray() and QString::fromStdWString() calls QString::fromUtf16(). The documentation for QString::fromUtf16() says that it checks for a byte order mark and that it's slow. The documentation for QString::fromWCharArray() and QString::fromStdWString() fails to mention this.