Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
Qt Creator 7.0.2
-
None
Description
Problem:
With UTF-8 source code files UTF-8 characters can be used directly in code. Usually they are most likely to be used in string literals. GCC (and i guess also other compilers) have no problem compiling source code with UTF-8 characters.
Unfortunately Qt Creator replaces (at least) the non-breaking space "\u00A0" when not used as an escaped character, but directly as UTF-8 character in the source file.
Steps to reproduce:
Create or edit a source file with a different editor and add a non-breaking space (Unicode 00A0) in a string literal.
Open the file in Qt Creator, change anything and save the file.
Expected behaviour:
The not changed parts of the file are not altered and saved as they were before.
Actual behaviour:
The non-breaking spaces (UTF-8 encoded 0xC2A0) get changed to normal spaces (UTF-8 / ASCII encoded 0x20).
More Information:
The default encoding in my Qt Creator is set to UTF-8. I also tried to disable the "clean whitespace" option of the editor (thinking that might could cause it), but this changed nothing.
Example:
See attached pictures before.png and after.png for a hex editor view of a source file before and after saving it with Qt Creator. The source file in the state of before.png is attached as main.cpp
Attachments
Issue Links
- duplicates
-
QTCREATORBUG-17875 QtCreator replaces non breaking spaces with "normal" spaces in documents
- Closed