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

Do not replace nbsp characters when creating text/plain mime data

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 6.2.2
    • Fix Version/s: 6.4.0 Beta1
    • Component/s: GUI: Drag and Drop
    • Labels:
      None
    • Commits:
      17eb0f2d8a (qt/qtbase/dev) 17eb0f2d8a (qt/tqtc-qtbase/dev)

      Description

      When copying from a QTextEdit with a non-breaking space character (nbsp,
      U+00A0), the character will be replaced by an ordinary whitespace in the "text/plain" mime data.

      This is different from other native text editors, at least on Windows; they preserve the character. It also creates an asymetry, because pasting such a character from another plain text editor works fine.

      The reason for this behavior is that the default QTextEdit uses QTextDocumentFragment::toPlainText(), which in turn uses QTextDocument::toPlainText(). The latter one is documented to replace U+00A0, U+2029, and U+2028 characters.

      A possible fix is to switch to QTextDocument::toRawText(), which avoids these conversions.

        Attachments

          Issue Links

          For Gerrit Dashboard: QTBUG-99572
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              kkohne Kai Köhne
              Reporter:
              kkohne Kai Köhne
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes