Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-7028

Q3TextDrag: failed HTML encode resolving when "meta http-equiv" tag isn't in a first tag of the document

    XMLWordPrintable

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);

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sorvig Morten Sørvig
            afalin Arseniy Ankudinov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes