Support UTF-8 BOM in TextEditor

TextEditor will now recognize an UTF-8 BOM.

A setting to determine what to do on saving has been added as well - the
options are "Always Add", "Keep Already Present" and (mostly for
completeness) "Always Delete".
Note: if encoding is "System", "Always Add" doesn't work, because there
is no API to know what the System encoding is.

Task-number: QTCREATORBUG-1857

Merge-request: 2180
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
Takumi ASAKI
2010-10-28 19:47:49 +02:00
committed by Oswald Buddenhagen
parent ab9f138ab4
commit 3cd32effdd
8 changed files with 145 additions and 6 deletions

View File

@@ -142,6 +142,7 @@ private:
};
LineTerminatorMode m_lineTerminatorMode;
QTextCodec *m_codec;
bool m_fileHasUtf8Bom;
bool m_fileIsReadOnly;
bool m_isBinaryData;