Why "\n" become "e2 80 a9" while output to textstream
-
@
QTextCursor cursor(block);
cursor.select(QTextCursor::BlockUnderCursor);
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"?
-
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.