summaryrefslogtreecommitdiffstats
path: root/tests/auto/linguist
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-20 15:35:41 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-20 15:48:25 (GMT)
commit68595bbc28ba0d1cd78557c61011dc004a4a507c (patch)
tree6c9c963f8e9d405fd18e399f8d5bff6c8f89293e /tests/auto/linguist
parentae653c8ff92c23c3f9ebbdb753a1e0edea95be7e (diff)
downloadQt-68595bbc28ba0d1cd78557c61011dc004a4a507c.zip
Qt-68595bbc28ba0d1cd78557c61011dc004a4a507c.tar.gz
Qt-68595bbc28ba0d1cd78557c61011dc004a4a507c.tar.bz2
fix encodings, take N
Task-number: QTBUG-4499 Task-number: QTBUG-5276
Diffstat (limited to 'tests/auto/linguist')
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecforsrc/main.cpp13
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.ts.result22
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr/project.ts.result2
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr1/main.cpp6
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.ts.result16
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr2/main.cpp5
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.ts.result11
7 files changed, 60 insertions, 15 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecforsrc/main.cpp b/tests/auto/linguist/lupdate/testdata/good/codecforsrc/main.cpp
index 158451a..d99723e 100644
--- a/tests/auto/linguist/lupdate/testdata/good/codecforsrc/main.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/codecforsrc/main.cpp
@@ -47,12 +47,21 @@
int main(int argc, char **argv)
{
QApplication a(argc, argv);
+ QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
+
QWidget w;
QLabel label1(QObject::tr("abc", "ascii"), &w);
QLabel label2(QObject::tr("æøå", "utf-8"), &w);
+ QLabel label2a(QObject::tr("\303\246\303\270\303\245", "utf-8 oct"), &w);
+ QLabel label3(QObject::trUtf8("Für Élise", "trUtf8"), &w);
+ QLabel label3a(QObject::trUtf8("F\303\274r \303\211lise", "trUtf8 oct"), &w);
-// I would expect the following to work !?
-// QLabel label3(QObject::trUtf8("F\374r \310lise", "trUtf8"), &w);
+ QBoxLayout *ly = new QVBoxLayout(&w);
+ ly->addWidget(&label1);
+ ly->addWidget(&label2);
+ ly->addWidget(&label2a);
+ ly->addWidget(&label3);
+ ly->addWidget(&label3a);
w.show();
return a.exec();
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.ts.result
index bc0d9bb..711bf02 100644
--- a/tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.ts.result
@@ -5,16 +5,34 @@
<context>
<name>QObject</name>
<message>
- <location filename="main.cpp" line="51"/>
+ <location filename="main.cpp" line="53"/>
<source>abc</source>
<comment>ascii</comment>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="main.cpp" line="52"/>
+ <location filename="main.cpp" line="54"/>
<source>æøå</source>
<comment>utf-8</comment>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <location filename="main.cpp" line="55"/>
+ <source>æøå</source>
+ <comment>utf-8 oct</comment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="56"/>
+ <source>Für Élise</source>
+ <comment>trUtf8</comment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="57"/>
+ <source>Für Élise</source>
+ <comment>trUtf8 oct</comment>
+ <translation type="unfinished"></translation>
+ </message>
</context>
</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/codecfortr/project.ts.result
index 91da744..6ee369a 100644
--- a/tests/auto/linguist/lupdate/testdata/good/codecfortr/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr/project.ts.result
@@ -6,7 +6,7 @@
<name>QObject</name>
<message>
<location filename="main.cpp" line="61"/>
- <source>Á</source>
+ <source>Б</source>
<translation type="unfinished"></translation>
</message>
</context>
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr1/main.cpp b/tests/auto/linguist/lupdate/testdata/good/codecfortr1/main.cpp
index abb8b89..98b491c 100644
--- a/tests/auto/linguist/lupdate/testdata/good/codecfortr1/main.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr1/main.cpp
@@ -49,9 +49,11 @@ public:
void doFoo()
{
tr("random ascii only");
- tr("this contains an umlaut &uuml;");
+ tr("this contains an umlaut &uuml; literally");
+ tr("this contains an umlaut \xfc &uuml; escaped");
trUtf8("random ascii only in utf8");
- trUtf8("umlaut \xfc &uuml; in utf8");
+ trUtf8("umlaut ü &uuml; in literal utf8");
+ trUtf8("umlaut \303\274 &uuml; in escaped utf8");
}
};
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.ts.result
index 26eb245..d548e24 100644
--- a/tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.ts.result
@@ -11,17 +11,27 @@
</message>
<message>
<location filename="main.cpp" line="52"/>
- <source>this contains an umlaut ü &amp;uuml;</source>
+ <source>this contains an umlaut ü &amp;uuml; literally</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.cpp" line="53"/>
+ <source>this contains an umlaut ü &amp;uuml; escaped</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="54"/>
<source>random ascii only in utf8</source>
<translation type="unfinished"></translation>
</message>
<message utf8="true">
- <location filename="main.cpp" line="54"/>
- <source>umlaut ü &amp;uuml; in utf8</source>
+ <location filename="main.cpp" line="55"/>
+ <source>umlaut ü &amp;uuml; in literal utf8</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message utf8="true">
+ <location filename="main.cpp" line="56"/>
+ <source>umlaut ü &amp;uuml; in escaped utf8</source>
<translation type="unfinished"></translation>
</message>
</context>
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr2/main.cpp b/tests/auto/linguist/lupdate/testdata/good/codecfortr2/main.cpp
index abb8b89..cd93539 100644
--- a/tests/auto/linguist/lupdate/testdata/good/codecfortr2/main.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr2/main.cpp
@@ -49,9 +49,10 @@ public:
void doFoo()
{
tr("random ascii only");
- tr("this contains an umlaut &uuml;");
+ tr("this contains an umlaut &uuml; literally");
+ tr("this contains an umlaut \303\274 &uuml; escaped, really in utf-8");
trUtf8("random ascii only in utf8");
- trUtf8("umlaut \xfc &uuml; in utf8");
+ trUtf8("umlaut \303\274 &uuml; in escaped utf8");
}
};
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.ts.result
index e27c157..6728a25 100644
--- a/tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.ts.result
@@ -11,17 +11,22 @@
</message>
<message>
<location filename="main.cpp" line="52"/>
- <source>this contains an umlaut ü &amp;uuml;</source>
+ <source>this contains an umlaut ü &amp;uuml; literally</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.cpp" line="53"/>
- <source>random ascii only in utf8</source>
+ <source>this contains an umlaut ü &amp;uuml; escaped, really in utf-8</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.cpp" line="54"/>
- <source>umlaut ü &amp;uuml; in utf8</source>
+ <source>random ascii only in utf8</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="55"/>
+ <source>umlaut ü &amp;uuml; in escaped utf8</source>
<translation type="unfinished"></translation>
</message>
</context>