Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
4.6.0
-
None
-
Windows, X11.
Description
Q3TextDrag::decode(const QMimeSource*, QString&, QString&) function uses static QTextCodec *codecForHTML(const QByteArray &), in which "pos" variable, pointing to char in "ba", replaced by position of char in substring "str". When charset is found, to "cs" put substring from start of document instead of substring from "str".
Possible solves:
1)
685c685
< codec = codecForHTML(e->encodedData(mime));
—
> codec = QTextCodec::codecForHtml(e->encodedData(mime));
2)
585,588c585,588
< pos = str.indexOf(QLatin1String("charset="), 0, Qt::CaseInsensitive) + int(strlen("charset="));
< if (pos != -1) {
< int pos2 = ba.indexOf('\"', pos+1);
< QByteArray cs = ba.mid(pos, pos2-pos);
—
> int pos1 = str.indexOf(QLatin1String("charset="), 0, Qt::CaseInsensitive) + int(strlen("charset="));
> if (pos1 != -1) {
> int pos2 = ba.indexOf('\"', pos+pos1+1);
> QByteArray cs = ba.mid(pos+pos1, pos2-pos-pos1);