summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/other/compiler/tst_compiler.cpp16
1 files changed, 16 insertions, 0 deletions
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"