Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Why "\n" become "e2 80 a9" while output to textstream
jemyzhang last edited by
QTextStream(file) << cursor.selectedText();
when I use the above code to select block into the text file, "\n" will become "e2 80 a9". and "e2 80 a9" is the return code in UTF-8. How can I convert the it back to "\n"?
Code_ReaQtor last edited by
I encountered the same problem before while creating a code editor. I think (since I stopped coding it and never applied this solution) it is a paragraph separator [QChar::ParagraphSeparator]. Check "this":http://www.fileformat.info/info/unicode/char/2029/index.htm and look for the UTF-8 encoding.