summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mkspecs/features/default_post.prf2
-rw-r--r--qmake/doc/src/qmake-manual.qdoc4
-rw-r--r--tests/auto/other/compiler/tst_compiler.cpp16
3 files changed, 19 insertions, 3 deletions
diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf
index 9c73eeef69..b2985fe89c 100644
--- a/mkspecs/features/default_post.prf
+++ b/mkspecs/features/default_post.prf
@@ -166,7 +166,7 @@ c99|c11 {
unset(cstd)
}
-utf8_source {
+!no_utf8_source {
QMAKE_CFLAGS += $$QMAKE_CFLAGS_UTF8_SOURCE
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_UTF8_SOURCE
}
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index 490d747f1b..16ed37c018 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -1147,8 +1147,8 @@
default is used.
\row \li thread \li Thread support is enabled. This is enabled when CONFIG
includes \c qt, which is the default.
- \row \li utf8_source \li Specifies that the project's source files use the
- UTF-8 encoding. By default, the compiler default is used.
+ \row \li no_utf8_source \li Specifies that the project's source files does not use
+ the UTF-8 encoding. Instead, the compiler default is used.
\row \li hide_symbols \li Set the default visibility of symbols in the binary
to hidden. By default, the compiler default is used.
\row \li c99 \li C99 support is enabled. This option has no effect if
diff --git a/tests/auto/other/compiler/tst_compiler.cpp b/tests/auto/other/compiler/tst_compiler.cpp
index 78026665be..4d19debd06 100644
--- a/tests/auto/other/compiler/tst_compiler.cpp
+++ b/tests/auto/other/compiler/tst_compiler.cpp
@@ -115,6 +115,9 @@ private slots:
/* Future / Technical specification compiler features */
void runtimeArrays();
+
+ /* treat source code as utf-8 */
+ void utf8source();
};
#if defined(Q_CC_HPACC)
@@ -1551,5 +1554,18 @@ void tst_Compiler::runtimeArrays()
#endif
}
+
+
+void tst_Compiler::utf8source()
+{
+ const char *str = "Ελληνικά";
+ auto u16str = u"Ελληνικά";
+ QCOMPARE(QString::fromUtf16(u16str), QString::fromUtf8(str));
+
+ const char *ae = "\xc3\x86";
+ auto u16ae = u"Æ";
+ QCOMPARE(QString::fromUtf16(u16ae), QString::fromUtf8(ae));
+}
+
QTEST_MAIN(tst_Compiler)
#include "tst_compiler.moc"