summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cpppreprocessor.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@digia.com>2013-12-12 21:36:01 +0100
committerNikolai Kosjar <nikolai.kosjar@digia.com>2014-05-23 14:23:41 +0200
commit57ff992961fcf8d0ff479a7038c2e517b5bc31a1 (patch)
tree64c4e41a1e79cbd13b8e2d048bef2c76be303526 /src/plugins/cpptools/cpppreprocessor.cpp
parent587eb49c4e44eec8d44e69cb24cd5c5f6743b84c (diff)
downloadqt-creator-57ff992961fcf8d0ff479a7038c2e517b5bc31a1.tar.gz
C++/CppTools: Pass UTF-8 encoded source to Lexer
The Lexer can handle it now. Task-number: QTCREATORBUG-7356 Change-Id: I8c4b03a247656e013d44c3cedca4835e133d4036 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/plugins/cpptools/cpppreprocessor.cpp')
-rw-r--r--src/plugins/cpptools/cpppreprocessor.cpp13
1 files changed, 0 insertions, 13 deletions
diff --git a/src/plugins/cpptools/cpppreprocessor.cpp b/src/plugins/cpptools/cpppreprocessor.cpp
index e5c9c9dbd3..c6dfc5012b 100644
--- a/src/plugins/cpptools/cpppreprocessor.cpp
+++ b/src/plugins/cpptools/cpppreprocessor.cpp
@@ -378,18 +378,6 @@ void CppPreprocessor::stopSkippingBlocks(unsigned offset)
m_currentDoc->stopSkippingBlocks(offset);
}
-// This is a temporary fix to handle non-ascii characters. This can be removed when the lexer can
-// handle multi-byte characters.
-static QByteArray convertToLatin1(const QByteArray &contents)
-{
- const char *p = contents.constData();
- while (char ch = *p++)
- if (ch & 0x80)
- return QString::fromUtf8(contents).toLatin1();
-
- return contents;
-}
-
void CppPreprocessor::sourceNeeded(unsigned line, const QString &fileName, IncludeType type)
{
typedef Document::DiagnosticMessage Message;
@@ -424,7 +412,6 @@ void CppPreprocessor::sourceNeeded(unsigned line, const QString &fileName, Inclu
unsigned editorRevision = 0;
QByteArray contents;
const bool gotFileContents = getFileContents(absoluteFileName, &contents, &editorRevision);
- contents = convertToLatin1(contents);
if (m_currentDoc && !gotFileContents) {
const QString text = QCoreApplication::translate(
"CppPreprocessor", "%1: Could not get file contents").arg(fileName);