Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.7.1
-
macOS 10.9, 10.11
Ubuntu 16.04
-
ae6681673eb5c7768070cad61f483d2a5405dc9e
Description
A non-breaking space (character 0xA0 or ALT+Space on Mac keyboard) typed into a source text is always replaced by a simple space. While this seems a good idea for any place where c++ expects white space (and cannot handle a nbsp) this also happens in string literals, like char* z=" "; (with a nbsp between " and "). This modifies behavior of the resulting program. This also happens if the code snippet is pasted in from the clipboard. This is a problem because you cannot tell by a look at the source whether it is a nbsp or a simple space.
Minimal example of the issue:
#include <QTextDocument> int main() { QString text (QChar::Nbsp); QTextDocument doc(text); QString plainText = doc.toPlainText(); return plainText != text; }
Attachments
Issue Links
- replaces
-
QTCREATORBUG-17875 QtCreator replaces non breaking spaces with "normal" spaces in documents
- Closed
For Gerrit Dashboard: QTBUG-56538 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
173955,2 | Add QTextDocument::toRawText() function | dev | qt/qtbase | Status: MERGED | +2 | 0 |