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

QTextDocument::toPlainText() replaces nbsp's with normal spaces

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.9.0 Beta 2
    • 5.7.1
    • GUI: Text handling
    • None
    • 3a9801d568e2f7d5a95ed4f5886a7f5062869456

    Description

      I am maintaining a text editor which uses QTextDocument. I have noticed that when a file contains non-breaking spaces, they are converted to normal spaces on saving.

      It looks like that happens in QTextDocument::toPlainText method. However that is not mentioned in the documentation, there is no comment about it in the source code, and git blame does not help because it traces to the initial commit in the Qt 4 repository.

      My question is: is this replacing still needed? And if yes, why?
      Can we have some API for getting the original text without replacing?

      Attachments

        Issue Links

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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              mandriver Dmitry Shachnev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes