diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp
index d839a4ca230752a47e3b84654e22fc8fb3306e1b..0886416e48dffe223ff35fc00d1126e2b5e2e2d2 100644
--- a/src/libs/cplusplus/CppDocument.cpp
+++ b/src/libs/cplusplus/CppDocument.cpp
@@ -494,10 +494,10 @@ Document::Ptr Document::create(const QString &fileName)
     return doc;
 }
 
-QByteArray Document::source() const
+QByteArray Document::utf8Source() const
 { return _source; }
 
-void Document::setSource(const QByteArray &source)
+void Document::setUtf8Source(const QByteArray &source)
 {
     _source = source;
     _translationUnit->setSource(_source.constBegin(), _source.size());
@@ -686,7 +686,7 @@ Document::Ptr Snapshot::documentFromSource(const QByteArray &preprocessedCode,
         newDoc->_macroUses = thisDocument->_macroUses;
     }
 
-    newDoc->setSource(preprocessedCode);
+    newDoc->setUtf8Source(preprocessedCode);
     return newDoc;
 }
 
diff --git a/src/libs/cplusplus/CppDocument.h b/src/libs/cplusplus/CppDocument.h
index bf04efca077d20d3c3279bbcdc6b2a61844f6fd0..fdd75447774c7db4d45a8a419db132310a2204e8 100644
--- a/src/libs/cplusplus/CppDocument.h
+++ b/src/libs/cplusplus/CppDocument.h
@@ -99,8 +99,8 @@ public:
     Symbol *lastVisibleSymbolAt(unsigned line, unsigned column = 0) const;
     Scope *scopeAt(unsigned line, unsigned column = 0);
 
-    QByteArray source() const;
-    void setSource(const QByteArray &source);
+    QByteArray utf8Source() const;
+    void setUtf8Source(const QByteArray &utf8Source);
 
     void startSkippingBlocks(unsigned offset);
     void stopSkippingBlocks(unsigned offset);
diff --git a/src/libs/cplusplus/FindUsages.cpp b/src/libs/cplusplus/FindUsages.cpp
index 88285e2d86aacbd4ff590c0ea1a14abfb349c789..3cde17fa5c49f2b1b9a758fb0831982039c7e2a5 100644
--- a/src/libs/cplusplus/FindUsages.cpp
+++ b/src/libs/cplusplus/FindUsages.cpp
@@ -79,7 +79,7 @@ FindUsages::FindUsages(const QByteArray &originalSource, Document::Ptr doc, cons
       _snapshot(snapshot),
       _context(doc, snapshot),
       _originalSource(originalSource),
-      _source(_doc->source()),
+      _source(_doc->utf8Source()),
       _currentScope(0)
 {
     _snapshot.insert(_doc);
@@ -93,8 +93,8 @@ FindUsages::FindUsages(const LookupContext &context)
       _doc(context.thisDocument()),
       _snapshot(context.snapshot()),
       _context(context),
-      _originalSource(_doc->source()),
-      _source(_doc->source()),
+      _originalSource(_doc->utf8Source()),
+      _source(_doc->utf8Source()),
       _currentScope(0)
 {
     typeofExpression.init(_doc, _snapshot, _context.bindings());
diff --git a/src/libs/cplusplus/TypeOfExpression.cpp b/src/libs/cplusplus/TypeOfExpression.cpp
index f6f6159b785d364b41f89b5ba83118ce65a2b77c..c6ab177de640ff3f8ef2b21f1201d3624636f1e9 100644
--- a/src/libs/cplusplus/TypeOfExpression.cpp
+++ b/src/libs/cplusplus/TypeOfExpression.cpp
@@ -177,7 +177,7 @@ Document::Ptr TypeOfExpression::documentForExpression(const QByteArray &utf8code
 {
     // create the expression's AST.
     Document::Ptr doc = Document::create(QLatin1String("<completion>"));
-    doc->setSource(utf8code);
+    doc->setUtf8Source(utf8code);
     doc->parse(Document::ParseExpression);
     return doc;
 }
diff --git a/src/plugins/cppeditor/cppchecksymbols.cpp b/src/plugins/cppeditor/cppchecksymbols.cpp
index e95adfb167f843caa26f9a03fc7ed5981fa92dc2..8b1deeac605d7c61966c24cf0ec5bdbe4178ae07 100644
--- a/src/plugins/cppeditor/cppchecksymbols.cpp
+++ b/src/plugins/cppeditor/cppchecksymbols.cpp
@@ -505,7 +505,7 @@ bool CheckSymbols::visit(MemberAccessAST *ast)
             if (_potentialMembers.contains(id)) {
                 const Token start = tokenAt(ast->firstToken());
                 const Token end = tokenAt(ast->lastToken() - 1);
-                const QByteArray expression = _doc->source().mid(start.begin(), end.end() - start.begin());
+                const QByteArray expression = _doc->utf8Source().mid(start.begin(), end.end() - start.begin());
 
                 const QList<LookupItem> candidates =
                     typeOfExpression(expression, enclosingScope(), TypeOfExpression::Preprocess);
@@ -568,7 +568,7 @@ QByteArray CheckSymbols::textOf(AST *ast) const
 {
     const Token start = tokenAt(ast->firstToken());
     const Token end = tokenAt(ast->lastToken() - 1);
-    const QByteArray text = _doc->source().mid(start.begin(), end.end() - start.begin());
+    const QByteArray text = _doc->utf8Source().mid(start.begin(), end.end() - start.begin());
     return text;
 }
 
diff --git a/src/plugins/cppeditor/cppfunctiondecldeflink.cpp b/src/plugins/cppeditor/cppfunctiondecldeflink.cpp
index d6fb74bf5fbc493c060c79818a690e07b536bc1c..e1dae57f518a1cf0120da3be18457d5a02632f4a 100644
--- a/src/plugins/cppeditor/cppfunctiondecldeflink.cpp
+++ b/src/plugins/cppeditor/cppfunctiondecldeflink.cpp
@@ -579,7 +579,7 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
             QString::fromUtf8(typeOfExpression.preprocess(newDeclText.toUtf8()));
 
     Document::Ptr newDeclDoc = Document::create(QLatin1String("<decl>"));
-    newDeclDoc->setSource(newDeclTextPreprocessed.toUtf8());
+    newDeclDoc->setUtf8Source(newDeclTextPreprocessed.toUtf8());
     newDeclDoc->parse(Document::ParseDeclaration);
     newDeclDoc->check();
 
@@ -810,7 +810,7 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
 
                 // don't change the name if it's in a comment
                 if (hasCommentedName(targetFile->cppDocument()->translationUnit(),
-                                     QLatin1String(targetFile->cppDocument()->source()),
+                                     QLatin1String(targetFile->cppDocument()->utf8Source()),
                                      targetFunctionDeclarator, existingParamIndex))
                     replacementName = 0;
 
diff --git a/src/plugins/cpptools/cppcodegen_test.cpp b/src/plugins/cpptools/cppcodegen_test.cpp
index 3bbdaf1e30f883ca521992c4cbc0ee23c2a95a1a..df07ce5d2dfc670eedb8796f74ba61f5bda9f905 100644
--- a/src/plugins/cpptools/cppcodegen_test.cpp
+++ b/src/plugins/cpptools/cppcodegen_test.cpp
@@ -72,7 +72,7 @@ void CppToolsPlugin::test_codegen_public_in_empty_class()
             "\n";
 
     Document::Ptr doc = Document::create("public_in_empty_class");
-    doc->setSource(src);
+    doc->setUtf8Source(src);
     doc->parse();
     doc->check();
 
@@ -112,7 +112,7 @@ void CppToolsPlugin::test_codegen_public_in_nonempty_class()
             "\n";
 
     Document::Ptr doc = Document::create("public_in_nonempty_class");
-    doc->setSource(src);
+    doc->setUtf8Source(src);
     doc->parse();
     doc->check();
 
@@ -152,7 +152,7 @@ void CppToolsPlugin::test_codegen_public_before_protected()
             "\n";
 
     Document::Ptr doc = Document::create("public_before_protected");
-    doc->setSource(src);
+    doc->setUtf8Source(src);
     doc->parse();
     doc->check();
 
@@ -193,7 +193,7 @@ void CppToolsPlugin::test_codegen_private_after_protected()
             "\n";
 
     Document::Ptr doc = Document::create("private_after_protected");
-    doc->setSource(src);
+    doc->setUtf8Source(src);
     doc->parse();
     doc->check();
 
@@ -234,7 +234,7 @@ void CppToolsPlugin::test_codegen_protected_in_nonempty_class()
             "\n";
 
     Document::Ptr doc = Document::create("protected_in_nonempty_class");
-    doc->setSource(src);
+    doc->setUtf8Source(src);
     doc->parse();
     doc->check();
 
@@ -275,7 +275,7 @@ void CppToolsPlugin::test_codegen_protected_between_public_and_private()
             "\n";
 
     Document::Ptr doc = Document::create("protected_betwee_public_and_private");
-    doc->setSource(src);
+    doc->setUtf8Source(src);
     doc->parse();
     doc->check();
 
@@ -336,7 +336,7 @@ void CppToolsPlugin::test_codegen_qtdesigner_integration()
             "#endif // MAINWINDOW_H\n";
 
     Document::Ptr doc = Document::create("qtdesigner_integration");
-    doc->setSource(src);
+    doc->setUtf8Source(src);
     doc->parse();
     doc->check();
 
@@ -380,7 +380,7 @@ void CppToolsPlugin::test_codegen_definition_empty_class()
     Utils::FileSaver srcSaver(src->fileName());
     srcSaver.write(srcText);
     srcSaver.finalize();
-    src->setSource(srcText);
+    src->setUtf8Source(srcText);
     src->parse();
     src->check();
     QCOMPARE(src->diagnosticMessages().size(), 0);
@@ -390,7 +390,7 @@ void CppToolsPlugin::test_codegen_definition_empty_class()
     Utils::FileSaver dstSaver(dst->fileName());
     dstSaver.write(dstText);
     dstSaver.finalize();
-    dst->setSource(dstText);
+    dst->setUtf8Source(dstText);
     dst->parse();
     dst->check();
     QCOMPARE(dst->diagnosticMessages().size(), 0);
@@ -448,7 +448,7 @@ void CppToolsPlugin::test_codegen_definition_first_member()
     Utils::FileSaver srcSaver(src->fileName());
     srcSaver.write(srcText);
     srcSaver.finalize();
-    src->setSource(srcText);
+    src->setUtf8Source(srcText);
     src->parse();
     src->check();
     QCOMPARE(src->diagnosticMessages().size(), 0);
@@ -459,7 +459,7 @@ void CppToolsPlugin::test_codegen_definition_first_member()
     Utils::FileSaver dstSaver(dst->fileName());
     dstSaver.write(dstText);
     dstSaver.finalize();
-    dst->setSource(dstText);
+    dst->setUtf8Source(dstText);
     dst->parse();
     dst->check();
     QCOMPARE(dst->diagnosticMessages().size(), 0);
@@ -517,7 +517,7 @@ void CppToolsPlugin::test_codegen_definition_last_member()
     Utils::FileSaver srcSaver(src->fileName());
     srcSaver.write(srcText);
     srcSaver.finalize();
-    src->setSource(srcText);
+    src->setUtf8Source(srcText);
     src->parse();
     src->check();
     QCOMPARE(src->diagnosticMessages().size(), 0);
@@ -528,7 +528,7 @@ void CppToolsPlugin::test_codegen_definition_last_member()
     Utils::FileSaver dstSaver(dst->fileName());
     dstSaver.write(dstText);
     dstSaver.finalize();
-    dst->setSource(dstText);
+    dst->setUtf8Source(dstText);
     dst->parse();
     dst->check();
     QCOMPARE(dst->diagnosticMessages().size(), 0);
@@ -592,7 +592,7 @@ void CppToolsPlugin::test_codegen_definition_middle_member()
     Utils::FileSaver srcSaver(src->fileName());
     srcSaver.write(srcText);
     srcSaver.finalize();
-    src->setSource(srcText);
+    src->setUtf8Source(srcText);
     src->parse();
     src->check();
     QCOMPARE(src->diagnosticMessages().size(), 0);
@@ -603,7 +603,7 @@ void CppToolsPlugin::test_codegen_definition_middle_member()
     Utils::FileSaver dstSaver(dst->fileName());
     dstSaver.write(dstText);
     dstSaver.finalize();
-    dst->setSource(dstText);
+    dst->setUtf8Source(dstText);
     dst->parse();
     dst->check();
     QCOMPARE(dst->diagnosticMessages().size(), 0);
diff --git a/src/plugins/cpptools/cppcompletionassist.cpp b/src/plugins/cpptools/cppcompletionassist.cpp
index ca17afe2ce7b75ecbdebc4f3ba3b5912cea1eb72..cd6e14be59e4546749760120f51de7b4c87f30c5 100644
--- a/src/plugins/cpptools/cppcompletionassist.cpp
+++ b/src/plugins/cpptools/cppcompletionassist.cpp
@@ -1844,7 +1844,7 @@ bool CppCompletionAssistProcessor::completeConstructorOrFunction(const QList<CPl
             QString possibleDecl = bs.mid(lineStartToken).trimmed().append("();");
 
             Document::Ptr doc = Document::create(QLatin1String("<completion>"));
-            doc->setSource(possibleDecl.toLatin1());
+            doc->setUtf8Source(possibleDecl.toLatin1());
             if (doc->parse(Document::ParseDeclaration)) {
                 doc->check();
                 if (SimpleDeclarationAST *sd = doc->translationUnit()->ast()->asSimpleDeclaration()) {
diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp
index 8e0b79cf3fe7667db89f91d76012e39c8b22c631..bf676e26e3f2b4f09d2d6193f8d877d0e2bfa43f 100644
--- a/src/plugins/cpptools/cppmodelmanager.cpp
+++ b/src/plugins/cpptools/cppmodelmanager.cpp
@@ -589,7 +589,7 @@ void CppPreprocessor::sourceNeeded(QString &fileName, IncludeType type, unsigned
 
     const QByteArray preprocessedCode = preprocess(fileName, contents);
 
-    doc->setSource(preprocessedCode);
+    doc->setUtf8Source(preprocessedCode);
     doc->keepSourceAndAST();
     doc->tokenize();
 
diff --git a/src/plugins/cpptools/doxygengenerator.cpp b/src/plugins/cpptools/doxygengenerator.cpp
index 8e3df8d6b8c66b7c7005ac56f5a373963fa4c63f..9883ceb322d8eb7e7b3af2e8a763ae0f31ab09e2 100644
--- a/src/plugins/cpptools/doxygengenerator.cpp
+++ b/src/plugins/cpptools/doxygengenerator.cpp
@@ -82,7 +82,7 @@ QString DoxygenGenerator::generate(QTextCursor cursor)
         declCandidate.append(QLatin1Char('}'));
 
     Document::Ptr doc = Document::create(QLatin1String("<doxygen>"));
-    doc->setSource(declCandidate.toUtf8());
+    doc->setUtf8Source(declCandidate.toUtf8());
     doc->parse(Document::ParseDeclaration);
     doc->check(Document::FastCheck);
 
diff --git a/src/plugins/qmljstools/qmljsfindexportedcpptypes.cpp b/src/plugins/qmljstools/qmljsfindexportedcpptypes.cpp
index e266f76b112d0f42da2c1891a0907a83a062f012..fe7c95b5c4adb84c8771a0a39b03f14ecc53df6a 100644
--- a/src/plugins/qmljstools/qmljsfindexportedcpptypes.cpp
+++ b/src/plugins/qmljstools/qmljsfindexportedcpptypes.cpp
@@ -264,7 +264,7 @@ protected:
         // and the expression
         const Token begin = translationUnit()->tokenAt(typeId->firstToken());
         const Token last = translationUnit()->tokenAt(typeId->lastToken() - 1);
-        exportedType.typeExpression = _doc->source().mid(begin.begin(), last.end() - begin.begin());
+        exportedType.typeExpression = _doc->utf8Source().mid(begin.begin(), last.end() - begin.begin());
 
         _exportedTypes += exportedType;
 
@@ -392,12 +392,12 @@ private:
     {
         const Token firstToken = translationUnit()->tokenAt(first);
         const Token lastToken = translationUnit()->tokenAt(last);
-        return _doc->source().mid(firstToken.begin(), lastToken.end() - firstToken.begin());
+        return _doc->utf8Source().mid(firstToken.begin(), lastToken.end() - firstToken.begin());
     }
 
     QString stringOf(const Token &token)
     {
-        return _doc->source().mid(token.begin(), token.length());
+        return _doc->utf8Source().mid(token.begin(), token.length());
     }
 
     ExpressionAST *skipStringCall(ExpressionAST *exp)
@@ -689,7 +689,7 @@ void FindExportedCppTypes::operator()(const CPlusPlus::Document::Ptr &document)
 
     // this check only guards against some input errors, if document's source and AST has not
     // been guarded properly the source and AST may still become empty/null while this function is running
-    if (document->source().isEmpty()
+    if (document->utf8Source().isEmpty()
             || !document->translationUnit()->ast())
         return;
 
@@ -710,7 +710,7 @@ void FindExportedCppTypes::operator()(const CPlusPlus::Document::Ptr &document)
     // context properties need lookup inside function scope, and thus require a full check
     Document::Ptr localDoc = document;
     if (document->checkMode() != Document::FullCheck && !contextPropertyDescriptions.isEmpty()) {
-        localDoc = m_snapshot.documentFromSource(document->source(), document->fileName());
+        localDoc = m_snapshot.documentFromSource(document->utf8Source(), document->fileName());
         localDoc->check();
     }
 
diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp
index beb90c1ed28f00d37558ce278cb9dee46c6a591c..19acd7460604b0b9b56ea1ca1c75b5c5a845b299 100644
--- a/src/plugins/qmljstools/qmljsmodelmanager.cpp
+++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp
@@ -710,7 +710,7 @@ void ModelManager::maybeQueueCppQmlTypeUpdate(const CPlusPlus::Document::Ptr &do
 {
     // avoid scanning documents without source code available
     doc->keepSourceAndAST();
-    if (doc->source().isEmpty()) {
+    if (doc->utf8Source().isEmpty()) {
         doc->releaseSourceAndAST();
         return;
     }
diff --git a/src/tools/gen-cpp-ast/generate-ast.cpp b/src/tools/gen-cpp-ast/generate-ast.cpp
index 1541872dc326581ee25e5b0ee2d9a6e1ced2dd5d..d0dbca1c1d40559e68a032478211b3b505b0f7e7 100644
--- a/src/tools/gen-cpp-ast/generate-ast.cpp
+++ b/src/tools/gen-cpp-ast/generate-ast.cpp
@@ -1069,7 +1069,7 @@ void generateAST_cpp(const Snapshot &snapshot, const QDir &cplusplusDir)
 
     Document::Ptr AST_cpp_document = Document::create(fileName);
     const QByteArray preprocessedCode = snapshot.preprocessedCode(source, fileName);
-    AST_cpp_document->setSource(preprocessedCode);
+    AST_cpp_document->setUtf8Source(preprocessedCode);
     AST_cpp_document->check();
 
     Overview oo;
@@ -1373,7 +1373,7 @@ QStringList generateAST_H(const Snapshot &snapshot, const QDir &cplusplusDir, co
 
     AST_h_document = Document::create(fileName);
     const QByteArray preprocessedCode = snapshot.preprocessedCode(source, fileName);
-    AST_h_document->setSource(preprocessedCode);
+    AST_h_document->setUtf8Source(preprocessedCode);
     AST_h_document->check();
 
     FindASTNodes process(AST_h_document, &document);
@@ -1520,7 +1520,7 @@ void generateASTFwd_h(const Snapshot &snapshot, const QDir &cplusplusDir, const
 
     Document::Ptr doc = Document::create(fileName);
     const QByteArray preprocessedCode = snapshot.preprocessedCode(source, fileName);
-    doc->setSource(preprocessedCode);
+    doc->setUtf8Source(preprocessedCode);
     doc->check();
 
     FindASTForwards process(doc, &document);
diff --git a/tests/auto/cplusplus/findusages/tst_findusages.cpp b/tests/auto/cplusplus/findusages/tst_findusages.cpp
index 912e20aa6b9d30f134c307595c43fab952a575a4..10107eb3f32af80188917408fa5f74ef5dd18d1c 100644
--- a/tests/auto/cplusplus/findusages/tst_findusages.cpp
+++ b/tests/auto/cplusplus/findusages/tst_findusages.cpp
@@ -100,7 +100,7 @@ void tst_FindUsages::inlineMethod()
                            "  }\n"
                            "};\n";
     Document::Ptr doc = Document::create("inlineMethod");
-    doc->setSource(src);
+    doc->setUtf8Source(src);
     doc->parse();
     doc->check();
 
@@ -143,7 +143,7 @@ const QByteArray objcSource = "\n"
 void tst_FindUsages::objc_args()
 {
     Document::Ptr doc = Document::create("objc_args");
-    doc->setSource(objcSource);
+    doc->setUtf8Source(objcSource);
     doc->parse();
     doc->check();
 
@@ -199,7 +199,7 @@ void tst_FindUsages::qproperty_1()
                            "  int _x;\n"
                            "};\n";
     Document::Ptr doc = Document::create("qproperty_1");
-    doc->setSource(src);
+    doc->setUtf8Source(src);
     doc->parse();
     doc->check();
 
diff --git a/tests/auto/cplusplus/lookup/tst_lookup.cpp b/tests/auto/cplusplus/lookup/tst_lookup.cpp
index 570b386c88dd883ed0693d61b00a9b0ea831ebfc..a4d3b9d295cac12e5f23f0f2bf79a6980617d85e 100644
--- a/tests/auto/cplusplus/lookup/tst_lookup.cpp
+++ b/tests/auto/cplusplus/lookup/tst_lookup.cpp
@@ -114,7 +114,7 @@ void tst_Lookup::base_class_defined_1()
         "class derived: public base {};\n";
 
     Document::Ptr doc = Document::create("base_class_defined_1");
-    doc->setSource(source);
+    doc->setUtf8Source(source);
     doc->parse();
     doc->check();
 
@@ -163,7 +163,7 @@ void tst_Lookup::simple_class_1()
         "@implementation Zoo +(id)alloc{} -(id)init{} -(void)dealloc{} @end\n";
 
     Document::Ptr doc = Document::create("simple_class_1");
-    doc->setSource(source);
+    doc->setUtf8Source(source);
     doc->parse();
     doc->check();
 
@@ -226,7 +226,7 @@ void tst_Lookup::class_with_baseclass()
                               "@implementation Zoo +(id)alloc{} -(id)init{} -(void)dealloc{} @end\n";
 
     Document::Ptr doc = Document::create("class_with_baseclass");
-    doc->setSource(source);
+    doc->setUtf8Source(source);
     doc->parse();
     doc->check();
 
@@ -287,7 +287,7 @@ void tst_Lookup::class_with_protocol_with_protocol()
                               "@implementation Zoo +(id)alloc{} -(id)init{} -(void)dealloc{} @end\n";
 
     Document::Ptr doc = Document::create("class_with_protocol_with_protocol");
-    doc->setSource(source);
+    doc->setUtf8Source(source);
     doc->parse();
     doc->check();
 
@@ -341,7 +341,7 @@ void tst_Lookup::iface_impl_scoping()
                               "@implementation Scooping-(int)method1:(int)arg{return arg;}@end\n";
 
     Document::Ptr doc = Document::create("class_with_protocol_with_protocol");
-    doc->setSource(source);
+    doc->setUtf8Source(source);
     doc->parse();
     doc->check();
 
@@ -431,7 +431,7 @@ void tst_Lookup::templates_1()
             "    l.end(); // std::_List_iterator<Point>\n"
             "}\n";
     Document::Ptr doc = Document::create("templates_1");
-    doc->setSource(source);
+    doc->setUtf8Source(source);
     doc->parse();
     doc->check();
 
@@ -462,7 +462,7 @@ void tst_Lookup::templates_2()
             "}\n"
 ;
     Document::Ptr doc = Document::create("templates_2");
-    doc->setSource(source);
+    doc->setUtf8Source(source);
     doc->parse();
     doc->check();
 
@@ -487,7 +487,7 @@ void tst_Lookup::templates_3()
             "    l.at(0); // const Point &\n"
             "}\n";
     Document::Ptr doc = Document::create("templates_3");
-    doc->setSource(source);
+    doc->setUtf8Source(source);
     doc->parse();
     doc->check();
 
@@ -528,7 +528,7 @@ void tst_Lookup::templates_4()
             "    (*l); // Point &\n"
             "}\n";
     Document::Ptr doc = Document::create("templates_4");
-    doc->setSource(source);
+    doc->setUtf8Source(source);
     doc->parse();
     doc->check();
 
@@ -558,7 +558,7 @@ void tst_Lookup::templates_5()
             "    a.get(); // const Point &\n"
             "}\n";
     Document::Ptr doc = Document::create("templates_5");
-    doc->setSource(source);
+    doc->setUtf8Source(source);
     doc->parse();
     doc->check();
 
diff --git a/tests/auto/cplusplus/misc/tst_misc.cpp b/tests/auto/cplusplus/misc/tst_misc.cpp
index 666f47bbae266e4b5725e4eda1ebe9b12c97e2bf..8b5df6e9daae6fa3c4004dac58a49bde25063bfa 100644
--- a/tests/auto/cplusplus/misc/tst_misc.cpp
+++ b/tests/auto/cplusplus/misc/tst_misc.cpp
@@ -59,7 +59,7 @@ void tst_Misc::diagnosticClient_error()
                          );
     Document::Ptr doc = Document::create("diagnosticClient_error");
     QVERIFY(!doc.isNull());
-    doc->setSource(src);
+    doc->setUtf8Source(src);
     bool success = doc->parse(Document::ParseTranlationUnit);
     QVERIFY(success);
 
@@ -79,7 +79,7 @@ void tst_Misc::diagnosticClient_warning()
                          );
     Document::Ptr doc = Document::create("diagnosticClient_warning");
     QVERIFY(!doc.isNull());
-    doc->setSource(src);
+    doc->setUtf8Source(src);
     bool success = doc->parse(Document::ParseTranlationUnit);
     QVERIFY(success);
 
@@ -132,7 +132,7 @@ void tst_Misc::findBreakpoints()
                          );
     Document::Ptr doc = Document::create("findContstructorBreakpoint");
     QVERIFY(!doc.isNull());
-    doc->setSource(src);
+    doc->setUtf8Source(src);
     bool success = doc->parse();
     QVERIFY(success);
     QCOMPARE(doc->diagnosticMessages().size(), 0);
@@ -161,7 +161,7 @@ void tst_Misc::findBreakpoints2()
                          );
     Document::Ptr doc = Document::create("findContstructorBreakpoint");
     QVERIFY(!doc.isNull());
-    doc->setSource(src);
+    doc->setUtf8Source(src);
     bool success = doc->parse();
     QVERIFY(success);
     QCOMPARE(doc->diagnosticMessages().size(), 0);