Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.6.0, 5.9.1
-
Windows XP
Description
Write a code that will check to see if it can convert a UTF16 string into MultiByte in the current locale is not possible.
QTextCodec::canEncode() always succeeds because:
This code:
QByteArray QWindowsLocalCodec::convertFromUnicode(const QChar *uc, int len, ConverterState *) const { return qt_winQString2MB(uc, len); }
does not use the converter state's 'invalidChars' param to be set to true if characters are replaced.
Edit: Testcase:
assert(!QTextCodec::codecForName("ASCII")->canEncode(QString::fromUtf8("t\xC3\xB6")));
It should be false since "tö" is encoded as "t?" with that codec.
Attachments
For Gerrit Dashboard: QTBUG-6925 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
217067,1 | WIP Attempt at reporting fromUnicode conversion errors with ICU | dev | qt/qtbase | Status: ABANDONED | -2 | 0 |
243054,5 | Increase invalidChars in case WideCharToMultiByte fails | 5.12 | qt/qtbase | Status: ABANDONED | +2 | 0 |