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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 6.4.0 Beta1
    • 6.2.2
    • GUI: Drag and Drop
    • None
    • 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

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

          Activity

            People

              kkohne Kai Köhne
              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