Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
4.7.4, 4.8.2
-
None
-
all
Description
Just a little exemple :
QTextCodec *_code = QTextCodec::codecForName(QString(QLatin1String("Windows-1252")).toLocal8Bit());
QString _t = _code->toUnicode("", 0);
the isNull() and the isEmpty() method of "_t" returns true or the isNull method must be return false.
Otherwise :
QString _t = QString::fromUtf8("", 0);
In this case isNull return false and isEmpty return true. (good result for me).
if we look into the code of qsimplecodec.cpp in the function convertToUnicode :
if (len <= 0 || chars == 0) return QString();
i think the problem is there and the code should be :
if (len < 0 ||chars == 0) return QString(); if (len == 0) return QString("");
This bug is very problematic for the database drivers