author | Eckhart Koeppen <eckhart.koppen@nokia.com> |
Thu, 08 Apr 2010 14:19:33 +0300 | |
branch | RCL_3 |
changeset 7 | 3f74d0d4af4c |
parent 4 | 3b1da2848fc7 |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the test suite of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
||
43 |
#include <QtTest/QtTest> |
|
44 |
||
45 |
#include <qtextcodec.h> |
|
46 |
#include <qfile.h> |
|
47 |
#include <qtextdocument.h> |
|
48 |
#include <time.h> |
|
49 |
#include <qprocess.h> |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
50 |
#include <QtConcurrentMap> |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
51 |
#include <QThreadPool> |
0 | 52 |
|
53 |
#ifdef Q_OS_SYMBIAN |
|
54 |
#define SRCDIR "" |
|
55 |
#endif |
|
56 |
||
57 |
||
58 |
class tst_QTextCodec : public QObject |
|
59 |
{ |
|
60 |
Q_OBJECT |
|
61 |
||
62 |
private slots: |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
63 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
64 |
void threadSafety(); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
65 |
|
0 | 66 |
void toUnicode_data(); |
67 |
void toUnicode(); |
|
68 |
void codecForName_data(); |
|
69 |
void codecForName(); |
|
70 |
void fromUnicode_data(); |
|
71 |
void fromUnicode(); |
|
72 |
void toUnicode_codecForHtml(); |
|
73 |
void toUnicode_incremental(); |
|
74 |
void codecForLocale(); |
|
75 |
||
76 |
void asciiToIscii() const; |
|
77 |
void flagCodepointFFFF() const; |
|
78 |
void flagF7808080() const; |
|
79 |
void flagEFBFBF() const; |
|
80 |
void decode0D() const; |
|
81 |
void codecForIndex() const; |
|
82 |
void aliasForUTF16() const; |
|
83 |
void mibForTSCII() const; |
|
84 |
||
85 |
void utf8Codec_data(); |
|
86 |
void utf8Codec(); |
|
87 |
||
88 |
void utf8bom_data(); |
|
89 |
void utf8bom(); |
|
90 |
||
91 |
void utfHeaders_data(); |
|
92 |
void utfHeaders(); |
|
93 |
||
94 |
void codecForHtml(); |
|
95 |
||
96 |
void codecForUtfText_data(); |
|
97 |
void codecForUtfText(); |
|
98 |
||
99 |
#ifdef Q_OS_UNIX |
|
100 |
void toLocal8Bit(); |
|
101 |
#endif |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
102 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
103 |
void invalidNames(); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
104 |
void checkAliases_data(); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
105 |
void checkAliases(); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
106 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
107 |
void moreToFromUnicode_data(); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
108 |
void moreToFromUnicode(); |
0 | 109 |
}; |
110 |
||
111 |
void tst_QTextCodec::toUnicode_data() |
|
112 |
{ |
|
113 |
QTest::addColumn<QString>("fileName"); |
|
114 |
QTest::addColumn<QString>("codecName"); |
|
115 |
||
116 |
QTest::newRow( "korean-eucKR" ) << SRCDIR "korean.txt" << "eucKR"; |
|
117 |
QTest::newRow( "UTF-8" ) << SRCDIR "utf8.txt" << "UTF-8"; |
|
118 |
} |
|
119 |
||
120 |
void tst_QTextCodec::toUnicode() |
|
121 |
{ |
|
122 |
QFETCH( QString, fileName ); |
|
123 |
QFETCH( QString, codecName ); |
|
124 |
||
125 |
QFile file( fileName ); |
|
126 |
||
127 |
if ( file.open( QIODevice::ReadOnly ) ) { |
|
128 |
QByteArray ba = file.readAll(); |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
129 |
QVERIFY(!ba.isEmpty()); |
0 | 130 |
QTextCodec *c = QTextCodec::codecForName( codecName.toLatin1() ); |
131 |
QVERIFY(c != 0); |
|
132 |
QString uniString = c->toUnicode( ba ); |
|
133 |
if (codecName == QLatin1String("UTF-8")) { |
|
134 |
QCOMPARE(uniString, QString::fromUtf8(ba)); |
|
135 |
QCOMPARE(ba, uniString.toUtf8()); |
|
136 |
} |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
137 |
QVERIFY(!uniString.isEmpty()); |
0 | 138 |
QCOMPARE( ba, c->fromUnicode( uniString ) ); |
139 |
||
140 |
if (codecName == QLatin1String("eucKR")) { |
|
141 |
char ch = '\0'; |
|
142 |
QVERIFY(c->toUnicode(&ch, 1).isEmpty()); |
|
143 |
QVERIFY(c->toUnicode(&ch, 1).isNull()); |
|
144 |
} |
|
145 |
} else { |
|
146 |
QFAIL(qPrintable("File could not be opened: " + file.errorString())); |
|
147 |
} |
|
148 |
} |
|
149 |
||
150 |
void tst_QTextCodec::codecForName_data() |
|
151 |
{ |
|
152 |
QTest::addColumn<QString>("hint"); |
|
153 |
QTest::addColumn<QString>("actualCodecName"); |
|
154 |
||
155 |
QTest::newRow("data1") << "iso88591" << "ISO-8859-1"; |
|
156 |
QTest::newRow("data2") << "iso88592" << "ISO-8859-2"; |
|
157 |
QTest::newRow("data3") << " IsO(8)8/5*9-2 " << "ISO-8859-2"; |
|
158 |
QTest::newRow("data4") << " IsO(8)8/5*2-9 " << ""; |
|
159 |
QTest::newRow("data5") << "latin2" << "ISO-8859-2"; |
|
160 |
} |
|
161 |
||
162 |
void tst_QTextCodec::codecForName() |
|
163 |
{ |
|
164 |
QFETCH(QString, hint); |
|
165 |
QFETCH(QString, actualCodecName); |
|
166 |
||
167 |
QTextCodec *codec = QTextCodec::codecForName(hint.toLatin1()); |
|
168 |
if (actualCodecName.isEmpty()) { |
|
169 |
QVERIFY(codec == 0); |
|
170 |
} else { |
|
171 |
QVERIFY(codec != 0); |
|
172 |
QCOMPARE(QString(codec->name()), actualCodecName); |
|
173 |
} |
|
174 |
} |
|
175 |
||
176 |
void tst_QTextCodec::fromUnicode_data() |
|
177 |
{ |
|
178 |
QTest::addColumn<QString>("codecName"); |
|
179 |
QTest::addColumn<bool>("eightBit"); |
|
180 |
||
181 |
QTest::newRow("data1") << "ISO-8859-1" << true; |
|
182 |
QTest::newRow("data2") << "ISO-8859-2" << true; |
|
183 |
QTest::newRow("data3") << "ISO-8859-3" << true; |
|
184 |
QTest::newRow("data4") << "ISO-8859-4" << true; |
|
185 |
QTest::newRow("data5") << "ISO-8859-5" << true; |
|
186 |
QTest::newRow("data6") << "ISO-8859-6" << true; |
|
187 |
QTest::newRow("data7") << "ISO-8859-7" << true; |
|
188 |
QTest::newRow("data8") << "ISO-8859-8" << true; |
|
189 |
QTest::newRow("data9") << "ISO-8859-9" << true; |
|
190 |
QTest::newRow("data10") << "ISO-8859-10" << true; |
|
191 |
QTest::newRow("data13") << "ISO-8859-13" << true; |
|
192 |
QTest::newRow("data14") << "ISO-8859-14" << true; |
|
193 |
QTest::newRow("data15") << "ISO-8859-15" << true; |
|
194 |
QTest::newRow("data16") << "ISO-8859-16" << true; |
|
195 |
||
196 |
QTest::newRow("data18") << "IBM850" << true; |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
197 |
#ifndef Q_OS_SYMBIAN //symbian implementation will return empty string if all char are invalid |
0 | 198 |
QTest::newRow("data19") << "IBM874" << true; |
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
199 |
#endif |
0 | 200 |
QTest::newRow("data20") << "IBM866" << true; |
201 |
||
202 |
QTest::newRow("data21") << "windows-1250" << true; |
|
203 |
QTest::newRow("data22") << "windows-1251" << true; |
|
204 |
QTest::newRow("data23") << "windows-1252" << true; |
|
205 |
QTest::newRow("data24") << "windows-1253" << true; |
|
206 |
QTest::newRow("data25") << "windows-1254" << true; |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
207 |
#ifndef Q_OS_SYMBIAN //symbian implementation will return empty string if all char are invalid |
0 | 208 |
QTest::newRow("data26") << "windows-1255" << true; |
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
209 |
#endif |
0 | 210 |
QTest::newRow("data27") << "windows-1256" << true; |
211 |
QTest::newRow("data28") << "windows-1257" << true; |
|
212 |
QTest::newRow("data28") << "windows-1258" << true; |
|
213 |
||
214 |
QTest::newRow("data29") << "Apple Roman" << true; |
|
215 |
QTest::newRow("data29") << "WINSAMI2" << true; |
|
216 |
QTest::newRow("data30") << "TIS-620" << true; |
|
217 |
QTest::newRow("data31") << "roman8" << true; |
|
218 |
||
219 |
QTest::newRow("data32") << "SJIS" << false; |
|
220 |
QTest::newRow("data33") << "EUC-KR" << false; |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
221 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
222 |
// all codecs from documentation |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
223 |
QTest::newRow("doc2") << "Big5" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
224 |
QTest::newRow("doc3") << "Big5-HKSCS" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
225 |
QTest::newRow("doc4") << "CP949" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
226 |
QTest::newRow("doc5") << "EUC-JP" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
227 |
QTest::newRow("doc6") << "EUC-KR" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
228 |
//QTest::newRow("doc7") << "GB18030-0" << false; // only GB18030 works |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
229 |
QTest::newRow("doc7-bis") << "GB18030" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
230 |
QTest::newRow("doc8") << "IBM 850" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
231 |
QTest::newRow("doc9") << "IBM 866" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
232 |
QTest::newRow("doc10") << "IBM 874" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
233 |
QTest::newRow("doc11") << "ISO 2022-JP" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
234 |
//ISO 8859-1 to 10 and ISO 8859-13 to 16 tested previously |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
235 |
// Iscii-Bng, Dev, Gjr, Knd, Mlm, Ori, Pnj, Tlg, and Tml tested in Iscii test |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
236 |
//QTest::newRow("doc12") << "JIS X 0201" << false; //actually not there |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
237 |
//QTest::newRow("doc13") << "JIS X 0208" << false; // actually not there |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
238 |
QTest::newRow("doc14") << "KOI8-R" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
239 |
QTest::newRow("doc15") << "KOI8-U" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
240 |
//QTest::newRow("doc16") << "MuleLao-1" << false; //only on x11 |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
241 |
QTest::newRow("doc17") << "ROMAN8" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
242 |
QTest::newRow("doc18") << "Shift-JIS" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
243 |
QTest::newRow("doc19") << "TIS-620" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
244 |
QTest::newRow("doc20") << "TSCII" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
245 |
QTest::newRow("doc21") << "UTF-8" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
246 |
QTest::newRow("doc22") << "UTF-16" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
247 |
QTest::newRow("doc23") << "UTF-16BE" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
248 |
QTest::newRow("doc24") << "UTF-16LE" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
249 |
QTest::newRow("doc25") << "UTF-32" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
250 |
QTest::newRow("doc26") << "UTF-32BE" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
251 |
QTest::newRow("doc27") << "UTF-32LE" << false; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
252 |
//Windows-1250 to 1258 tested previously |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
253 |
QTest::newRow("doc3") << "WINSAMI2" << false; |
0 | 254 |
} |
255 |
||
256 |
void tst_QTextCodec::fromUnicode() |
|
257 |
{ |
|
258 |
QFETCH(QString, codecName); |
|
259 |
QFETCH(bool, eightBit); |
|
260 |
||
261 |
QTextCodec *codec = QTextCodec::codecForName(codecName.toLatin1()); |
|
262 |
QVERIFY(codec != 0); |
|
263 |
||
264 |
// Check if the reverse lookup is what we expect |
|
265 |
if (eightBit) { |
|
266 |
char chars[128]; |
|
267 |
for (int i = 0; i < 128; ++i) |
|
268 |
chars[i] = i + 128; |
|
269 |
QString s = codec->toUnicode(chars, 128); |
|
270 |
QByteArray c = codec->fromUnicode(s); |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
271 |
QCOMPARE(c.size(), 128); |
0 | 272 |
|
273 |
int numberOfQuestionMarks = 0; |
|
274 |
for (int i = 0; i < 128; ++i) { |
|
275 |
if (c.at(i) == '?') |
|
276 |
++numberOfQuestionMarks; |
|
277 |
else |
|
278 |
QCOMPARE(c.at(i), char(i + 128)); |
|
279 |
} |
|
280 |
QVERIFY(numberOfQuestionMarks != 128); |
|
281 |
} |
|
282 |
||
283 |
/* |
|
284 |
If the encoding is a superset of ASCII, test that the byte |
|
285 |
array is correct (no off by one, no trailing '\0'). |
|
286 |
*/ |
|
287 |
QByteArray result = codec->fromUnicode(QString("abc")); |
|
288 |
if (result.startsWith("a")) { |
|
289 |
QCOMPARE(result.size(), 3); |
|
290 |
QCOMPARE(result, QByteArray("abc")); |
|
291 |
} else { |
|
292 |
QVERIFY(true); |
|
293 |
} |
|
294 |
} |
|
295 |
||
296 |
void tst_QTextCodec::toUnicode_codecForHtml() |
|
297 |
{ |
|
298 |
QFile file(QString(SRCDIR "QT4-crashtest.txt")); |
|
299 |
QVERIFY(file.open(QFile::ReadOnly)); |
|
300 |
||
301 |
QByteArray data = file.readAll(); |
|
302 |
QTextCodec *codec = Qt::codecForHtml(data); |
|
303 |
codec->toUnicode(data); // this line crashes |
|
304 |
} |
|
305 |
||
306 |
||
307 |
void tst_QTextCodec::toUnicode_incremental() |
|
308 |
{ |
|
309 |
QByteArray ba; |
|
310 |
ba += char(0xf0); |
|
311 |
ba += char(0x90); |
|
312 |
ba += char(0x80); |
|
313 |
ba += char(0x80); |
|
314 |
ba += char(0xf4); |
|
315 |
ba += char(0x8f); |
|
316 |
ba += char(0xbf); |
|
317 |
ba += char(0xbd); |
|
318 |
||
319 |
QString expected = QString::fromUtf8(ba); |
|
320 |
||
321 |
QString incremental; |
|
322 |
QTextDecoder *utf8Decoder = QTextCodec::codecForMib(106)->makeDecoder(); |
|
323 |
||
324 |
QString actual; |
|
325 |
for (int i = 0; i < ba.size(); ++i) |
|
326 |
utf8Decoder->toUnicode(&actual, ba.constData() + i, 1); |
|
327 |
||
328 |
QCOMPARE(actual, expected); |
|
329 |
||
330 |
||
331 |
delete utf8Decoder; |
|
332 |
} |
|
333 |
||
334 |
void tst_QTextCodec::codecForLocale() |
|
335 |
{ |
|
336 |
QTextCodec *codec = QTextCodec::codecForLocale(); |
|
337 |
QVERIFY(codec != 0); |
|
338 |
||
339 |
#if defined(Q_OS_UNIX) |
|
340 |
// get a time string that is locale-encoded |
|
341 |
QByteArray originalLocaleEncodedTimeString; |
|
342 |
originalLocaleEncodedTimeString.resize(1024); |
|
343 |
time_t t; |
|
344 |
time(&t); |
|
345 |
int r = strftime(originalLocaleEncodedTimeString.data(), |
|
346 |
originalLocaleEncodedTimeString.size(), |
|
347 |
"%A%a%B%b%Z", |
|
348 |
localtime(&t)); |
|
349 |
if (r == 0) |
|
350 |
QSKIP("strftime() failed", SkipAll); |
|
351 |
originalLocaleEncodedTimeString.resize(r); |
|
352 |
||
353 |
QString unicodeTimeString = codec->toUnicode(originalLocaleEncodedTimeString); |
|
354 |
QByteArray localeEncodedTimeString = codec->fromUnicode(unicodeTimeString); |
|
355 |
QCOMPARE(localeEncodedTimeString, originalLocaleEncodedTimeString); |
|
356 |
#else |
|
357 |
QSKIP("This test is not implemented on Windows", SkipAll); |
|
358 |
#endif |
|
359 |
||
360 |
// find a codec that is not the codecForLocale() |
|
361 |
QTextCodec *codec2 = 0; |
|
362 |
foreach (int mib, QTextCodec::availableMibs()) { |
|
363 |
if (mib != codec->mibEnum()) { |
|
364 |
codec2 = QTextCodec::codecForMib(mib); |
|
365 |
if (codec2) |
|
366 |
break; |
|
367 |
} |
|
368 |
} |
|
369 |
if (!codec2) { |
|
370 |
QSKIP("Could not find a codec that is not already the codecForLocale()", SkipAll); |
|
371 |
} |
|
372 |
||
373 |
// set it, codecForLocale() should return it now |
|
374 |
QTextCodec::setCodecForLocale(codec2); |
|
375 |
QCOMPARE(QTextCodec::codecForLocale(), codec2); |
|
376 |
||
377 |
// reset back to the default |
|
378 |
QTextCodec::setCodecForLocale(0); |
|
379 |
QCOMPARE(QTextCodec::codecForLocale(), codec); |
|
380 |
} |
|
381 |
||
382 |
void tst_QTextCodec::asciiToIscii() const |
|
383 |
{ |
|
384 |
/* Add all low, 7-bit ASCII characters. */ |
|
385 |
QString ascii; |
|
386 |
const int len = 0xA0 - 1; |
|
387 |
ascii.resize(len); |
|
388 |
||
389 |
for(int i = 0; i < len; ++i) |
|
390 |
ascii[i] = QChar(i + 1); |
|
391 |
||
392 |
static const char *const isciiCodecs[] = |
|
393 |
{ |
|
394 |
"Iscii-Mlm", |
|
395 |
"Iscii-Knd", |
|
396 |
"Iscii-Tlg", |
|
397 |
"Iscii-Tml", |
|
398 |
"Iscii-Ori", |
|
399 |
"Iscii-Gjr", |
|
400 |
"Iscii-Pnj", |
|
401 |
"Iscii-Bng", |
|
402 |
"Iscii-Dev" |
|
403 |
}; |
|
404 |
const int isciiCodecsLen = sizeof(isciiCodecs) / sizeof(const char *); |
|
405 |
||
406 |
for(int i = 0; i < isciiCodecsLen; ++i) { |
|
407 |
/* For each codec. */ |
|
408 |
||
409 |
const QTextCodec *const textCodec = QTextCodec::codecForName(isciiCodecs[i]); |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
410 |
QVERIFY(textCodec); |
0 | 411 |
|
412 |
for(int i2 = 0; i2 < len; ++i2) { |
|
413 |
/* For each character in ascii. */ |
|
414 |
const QChar c(ascii[i2]); |
|
415 |
QVERIFY2(textCodec->canEncode(c), qPrintable(QString::fromLatin1("Failed to encode %1 with encoding %2") |
|
416 |
.arg(QString::number(c.unicode()), QString::fromLatin1(textCodec->name().constData())))); |
|
417 |
} |
|
418 |
||
419 |
QVERIFY2(textCodec->canEncode(ascii), qPrintable(QString::fromLatin1("Failed for full string with encoding %1") |
|
420 |
.arg(QString::fromLatin1(textCodec->name().constData())))); |
|
421 |
} |
|
422 |
} |
|
423 |
||
424 |
void tst_QTextCodec::flagCodepointFFFF() const |
|
425 |
{ |
|
426 |
// This is an invalid Unicode codepoint. |
|
427 |
const QChar ch(0xFFFF); |
|
428 |
QString input(ch); |
|
429 |
||
430 |
QTextCodec *const codec = QTextCodec::codecForMib(106); // UTF-8 |
|
431 |
Q_ASSERT(codec); |
|
432 |
||
433 |
const QByteArray asDecoded(codec->fromUnicode(input)); |
|
434 |
QTextCodec::ConverterState state(QTextCodec::ConvertInvalidToNull); |
|
435 |
QVERIFY(codec->toUnicode(asDecoded.constData(), asDecoded.length(), &state) == QChar(0)); |
|
436 |
QVERIFY(codec->toUnicode(asDecoded) == QChar(0xfffd)); |
|
437 |
} |
|
438 |
||
439 |
void tst_QTextCodec::flagF7808080() const |
|
440 |
{ |
|
441 |
/* This test case stems from test not-wf-sa-170, tests/qxmlstream/XML-Test-Suite/xmlconf/xmltest/not-wf/sa/166.xml, |
|
442 |
* whose description reads: |
|
443 |
* |
|
444 |
* "Four byte UTF-8 encodings can encode UCS-4 characters |
|
445 |
* which are beyond the range of legal XML characters |
|
446 |
* (and can't be expressed in Unicode surrogate pairs). |
|
447 |
* This document holds such a character." |
|
448 |
* |
|
449 |
* In binary, this is: |
|
450 |
* 11110111100000001000000010000000 |
|
451 |
* * * * * |
|
452 |
* 11110www10xxxxxx10yyyyyy10zzzzzz |
|
453 |
* |
|
454 |
* With multibyte logic removed it is the codepoint 0x1C0000. |
|
455 |
*/ |
|
456 |
QByteArray input; |
|
457 |
input.resize(4); |
|
458 |
input[0] = char(0xF7); |
|
459 |
input[1] = char(0x80); |
|
460 |
input[2] = char(0x80); |
|
461 |
input[3] = char(0x80); |
|
462 |
||
463 |
||
464 |
QTextCodec *const codec = QTextCodec::codecForMib(106); // UTF-8 |
|
465 |
Q_ASSERT(codec); |
|
466 |
||
467 |
//QVERIFY(!codec->canEncode(QChar(0x1C0000))); |
|
468 |
||
469 |
QTextCodec::ConverterState state(QTextCodec::ConvertInvalidToNull); |
|
470 |
QVERIFY(codec->toUnicode(input.constData(), input.length(), &state) == QChar(0)); |
|
471 |
} |
|
472 |
||
473 |
void tst_QTextCodec::flagEFBFBF() const |
|
474 |
{ |
|
475 |
QByteArray invalidInput; |
|
476 |
invalidInput.resize(3); |
|
477 |
invalidInput[0] = char(0xEF); |
|
478 |
invalidInput[1] = char(0xBF); |
|
479 |
invalidInput[2] = char(0xBF); |
|
480 |
||
481 |
const QTextCodec *const codec = QTextCodec::codecForMib(106); // UTF-8 |
|
482 |
Q_ASSERT(codec); |
|
483 |
||
484 |
{ |
|
485 |
//QVERIFY(!codec->canEncode(QChar(0xFFFF))); |
|
486 |
QTextCodec::ConverterState state(QTextCodec::ConvertInvalidToNull); |
|
487 |
QVERIFY(codec->toUnicode(invalidInput.constData(), invalidInput.length(), &state) == QChar(0)); |
|
488 |
||
489 |
QByteArray start("<?pi "); |
|
490 |
start.append(invalidInput); |
|
491 |
start.append("?>"); |
|
492 |
} |
|
493 |
||
494 |
/* When 0xEFBFBF is preceeded by what seems to be an arbitrary character, |
|
495 |
* QTextCodec fails to flag it. */ |
|
496 |
{ |
|
497 |
QEXPECT_FAIL("", "This is a bug and needs to be fixed.", Continue); |
|
498 |
QByteArray start("B"); |
|
499 |
start.append(invalidInput); |
|
500 |
||
501 |
QTextCodec::ConverterState state(QTextCodec::ConvertInvalidToNull); |
|
502 |
QVERIFY(codec->toUnicode(start.constData(), start.length(), &state) == QChar(0)); |
|
503 |
} |
|
504 |
} |
|
505 |
||
506 |
void tst_QTextCodec::decode0D() const |
|
507 |
{ |
|
508 |
QByteArray input; |
|
509 |
input.resize(3); |
|
510 |
input[0] = 'A'; |
|
511 |
input[1] = '\r'; |
|
512 |
input[2] = 'B'; |
|
513 |
||
514 |
QCOMPARE(QString::fromUtf8(input.constData()).toUtf8(), input); |
|
515 |
} |
|
516 |
||
517 |
void tst_QTextCodec::codecForIndex() const |
|
518 |
{ |
|
519 |
} |
|
520 |
||
521 |
void tst_QTextCodec::aliasForUTF16() const |
|
522 |
{ |
|
523 |
QVERIFY(QTextCodec::codecForName("UTF-16")->aliases().isEmpty()); |
|
524 |
} |
|
525 |
||
526 |
void tst_QTextCodec::mibForTSCII() const |
|
527 |
{ |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
528 |
QTextCodec *codec = QTextCodec::codecForName("TSCII"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
529 |
QVERIFY(codec); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
530 |
QCOMPARE(codec->mibEnum(), 2107); |
0 | 531 |
} |
532 |
||
533 |
static QString fromInvalidUtf8Sequence(const QByteArray &ba) |
|
534 |
{ |
|
535 |
return QString().fill(QChar::ReplacementCharacter, ba.size()); |
|
536 |
} |
|
537 |
||
538 |
// copied from tst_QString::fromUtf8_data() |
|
539 |
void tst_QTextCodec::utf8Codec_data() |
|
540 |
{ |
|
541 |
QTest::addColumn<QByteArray>("utf8"); |
|
542 |
QTest::addColumn<QString>("res"); |
|
543 |
QTest::addColumn<int>("len"); |
|
544 |
QString str; |
|
545 |
||
546 |
QTest::newRow("str0") << QByteArray("abcdefgh") << QString("abcdefgh") << -1; |
|
547 |
QTest::newRow("str0-len") << QByteArray("abcdefgh") << QString("abc") << 3; |
|
548 |
QTest::newRow("str1") << QByteArray("\303\266\303\244\303\274\303\226\303\204\303\234\303\270\303\246\303\245\303\230\303\206\303\205") << QString("\366\344\374\326\304\334\370\346\345\330\306\305") << -1; |
|
549 |
QTest::newRow("str1-len") << QByteArray("\303\266\303\244\303\274\303\226\303\204\303\234\303\270\303\246\303\245\303\230\303\206\303\205") << QString("\366\344\374\326\304") << 10; |
|
550 |
||
551 |
str += QChar(0x05e9); |
|
552 |
str += QChar(0x05d3); |
|
553 |
str += QChar(0x05d2); |
|
554 |
QTest::newRow("str2") << QByteArray("\327\251\327\223\327\222") << str << -1; |
|
555 |
||
556 |
str = QChar(0x05e9); |
|
557 |
QTest::newRow("str2-len") << QByteArray("\327\251\327\223\327\222") << str << 2; |
|
558 |
||
559 |
str = QChar(0x20ac); |
|
560 |
str += " some text"; |
|
561 |
QTest::newRow("str3") << QByteArray("\342\202\254 some text") << str << -1; |
|
562 |
||
563 |
str = QChar(0x20ac); |
|
564 |
str += " some "; |
|
565 |
QTest::newRow("str3-len") << QByteArray("\342\202\254 some text") << str << 9; |
|
566 |
||
567 |
str = "hello"; |
|
568 |
str += QChar::ReplacementCharacter; |
|
569 |
str += QChar(0x68); |
|
570 |
str += QChar::ReplacementCharacter; |
|
571 |
str += QChar::ReplacementCharacter; |
|
572 |
str += QChar::ReplacementCharacter; |
|
573 |
str += QChar::ReplacementCharacter; |
|
574 |
str += QChar(0x61); |
|
575 |
str += QChar::ReplacementCharacter; |
|
576 |
QTest::newRow("invalid utf8") << QByteArray("hello\344h\344\344\366\344a\304") << str << -1; |
|
577 |
QTest::newRow("invalid utf8-len") << QByteArray("hello\344h\344\344\366\344a\304") << QString("hello") << 5; |
|
578 |
||
579 |
str = "Prohl"; |
|
580 |
str += QChar::ReplacementCharacter; |
|
581 |
str += QChar::ReplacementCharacter; |
|
582 |
str += "e"; |
|
583 |
str += QChar::ReplacementCharacter; |
|
584 |
str += " plugin"; |
|
585 |
str += QChar::ReplacementCharacter; |
|
586 |
str += " Netscape"; |
|
587 |
||
588 |
QTest::newRow("task28417") << QByteArray("Prohl\355\276e\350 plugin\371 Netscape") << str << -1; |
|
589 |
QTest::newRow("task28417-len") << QByteArray("Prohl\355\276e\350 plugin\371 Netscape") << QString("") << 0; |
|
590 |
||
591 |
QTest::newRow("null-1") << QByteArray() << QString() << -1; |
|
592 |
QTest::newRow("null0") << QByteArray() << QString() << 0; |
|
593 |
// QTest::newRow("null5") << QByteArray() << QString() << 5; |
|
594 |
QTest::newRow("empty-1") << QByteArray("\0abcd", 5) << QString() << -1; |
|
595 |
QTest::newRow("empty0") << QByteArray() << QString() << 0; |
|
596 |
QTest::newRow("empty5") << QByteArray("\0abcd", 5) << QString::fromAscii("\0abcd", 5) << 5; |
|
597 |
QTest::newRow("other-1") << QByteArray("ab\0cd", 5) << QString::fromAscii("ab") << -1; |
|
598 |
QTest::newRow("other5") << QByteArray("ab\0cd", 5) << QString::fromAscii("ab\0cd", 5) << 5; |
|
599 |
||
600 |
str = "Old Italic: "; |
|
601 |
str += QChar(0xd800); |
|
602 |
str += QChar(0xdf00); |
|
603 |
str += QChar(0xd800); |
|
604 |
str += QChar(0xdf01); |
|
605 |
str += QChar(0xd800); |
|
606 |
str += QChar(0xdf02); |
|
607 |
str += QChar(0xd800); |
|
608 |
str += QChar(0xdf03); |
|
609 |
str += QChar(0xd800); |
|
610 |
str += QChar(0xdf04); |
|
611 |
QTest::newRow("surrogate") << QByteArray("Old Italic: \360\220\214\200\360\220\214\201\360\220\214\202\360\220\214\203\360\220\214\204") << str << -1; |
|
612 |
||
613 |
QTest::newRow("surrogate-len") << QByteArray("Old Italic: \360\220\214\200\360\220\214\201\360\220\214\202\360\220\214\203\360\220\214\204") << str.left(16) << 20; |
|
614 |
||
615 |
// from http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html |
|
616 |
||
617 |
// 2.1.1 U+00000000 |
|
618 |
QByteArray utf8; |
|
619 |
utf8 += char(0x00); |
|
620 |
str = QChar(QChar::Null); |
|
621 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.1.1") << utf8 << str << 1; |
|
622 |
||
623 |
// 2.1.2 U+00000080 |
|
624 |
utf8.clear(); |
|
625 |
utf8 += char(0xc2); |
|
626 |
utf8 += char(0x80); |
|
627 |
str = QChar(0x80); |
|
628 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.1.2") << utf8 << str << -1; |
|
629 |
||
630 |
// 2.1.3 U+00000800 |
|
631 |
utf8.clear(); |
|
632 |
utf8 += char(0xe0); |
|
633 |
utf8 += char(0xa0); |
|
634 |
utf8 += char(0x80); |
|
635 |
str = QChar(0x800); |
|
636 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.1.3") << utf8 << str << -1; |
|
637 |
||
638 |
// 2.1.4 U+00010000 |
|
639 |
utf8.clear(); |
|
640 |
utf8 += char(0xf0); |
|
641 |
utf8 += char(0x90); |
|
642 |
utf8 += char(0x80); |
|
643 |
utf8 += char(0x80); |
|
644 |
str.clear(); |
|
645 |
str += QChar(0xd800); |
|
646 |
str += QChar(0xdc00); |
|
647 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.1.4") << utf8 << str << -1; |
|
648 |
||
649 |
// 2.1.5 U+00200000 (not a valid Unicode character) |
|
650 |
utf8.clear(); |
|
651 |
utf8 += char(0xf8); |
|
652 |
utf8 += char(0x88); |
|
653 |
utf8 += char(0x80); |
|
654 |
utf8 += char(0x80); |
|
655 |
utf8 += char(0x80); |
|
656 |
str = fromInvalidUtf8Sequence(utf8); |
|
657 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.1.5") << utf8 << str << -1; |
|
658 |
||
659 |
// 2.1.6 U+04000000 (not a valid Unicode character) |
|
660 |
utf8.clear(); |
|
661 |
utf8 += char(0xfc); |
|
662 |
utf8 += char(0x84); |
|
663 |
utf8 += char(0x80); |
|
664 |
utf8 += char(0x80); |
|
665 |
utf8 += char(0x80); |
|
666 |
utf8 += char(0x80); |
|
667 |
str = fromInvalidUtf8Sequence(utf8); |
|
668 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.1.6") << utf8 << str << -1; |
|
669 |
||
670 |
// 2.2.1 U+0000007F |
|
671 |
utf8.clear(); |
|
672 |
utf8 += char(0x7f); |
|
673 |
str = QChar(0x7f); |
|
674 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.2.1") << utf8 << str << -1; |
|
675 |
||
676 |
// 2.2.2 U+000007FF |
|
677 |
utf8.clear(); |
|
678 |
utf8 += char(0xdf); |
|
679 |
utf8 += char(0xbf); |
|
680 |
str = QChar(0x7ff); |
|
681 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.2.2") << utf8 << str << -1; |
|
682 |
||
683 |
// 2.2.3 U+000FFFF |
|
684 |
utf8.clear(); |
|
685 |
utf8 += char(0xef); |
|
686 |
utf8 += char(0xbf); |
|
687 |
utf8 += char(0xbf); |
|
688 |
str.clear(); |
|
689 |
str += QChar::ReplacementCharacter; |
|
690 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.2.3") << utf8 << str << -1; |
|
691 |
||
692 |
// 2.2.4 U+001FFFFF |
|
693 |
utf8.clear(); |
|
694 |
utf8 += char(0xf7); |
|
695 |
utf8 += char(0xbf); |
|
696 |
utf8 += char(0xbf); |
|
697 |
utf8 += char(0xbf); |
|
698 |
str.clear(); |
|
699 |
str += QChar(QChar::ReplacementCharacter); |
|
700 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.2.4") << utf8 << str << -1; |
|
701 |
||
702 |
// 2.2.5 U+03FFFFFF (not a valid Unicode character) |
|
703 |
utf8.clear(); |
|
704 |
utf8 += char(0xfb); |
|
705 |
utf8 += char(0xbf); |
|
706 |
utf8 += char(0xbf); |
|
707 |
utf8 += char(0xbf); |
|
708 |
utf8 += char(0xbf); |
|
709 |
str = fromInvalidUtf8Sequence(utf8); |
|
710 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.2.5") << utf8 << str << -1; |
|
711 |
||
712 |
// 2.2.6 U+7FFFFFFF |
|
713 |
utf8.clear(); |
|
714 |
utf8 += char(0xfd); |
|
715 |
utf8 += char(0xbf); |
|
716 |
utf8 += char(0xbf); |
|
717 |
utf8 += char(0xbf); |
|
718 |
utf8 += char(0xbf); |
|
719 |
utf8 += char(0xbf); |
|
720 |
str = fromInvalidUtf8Sequence(utf8); |
|
721 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.2.6") << utf8 << str << -1; |
|
722 |
||
723 |
// 2.3.1 U+0000D7FF |
|
724 |
utf8.clear(); |
|
725 |
utf8 += char(0xed); |
|
726 |
utf8 += char(0x9f); |
|
727 |
utf8 += char(0xbf); |
|
728 |
str = QChar(0xd7ff); |
|
729 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.3.1") << utf8 << str << -1; |
|
730 |
||
731 |
// 2.3.2 U+0000E000 |
|
732 |
utf8.clear(); |
|
733 |
utf8 += char(0xee); |
|
734 |
utf8 += char(0x80); |
|
735 |
utf8 += char(0x80); |
|
736 |
str = QChar(0xe000); |
|
737 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.3.2") << utf8 << str << -1; |
|
738 |
||
739 |
// 2.3.3 U+0000FFFD |
|
740 |
utf8.clear(); |
|
741 |
utf8 += char(0xef); |
|
742 |
utf8 += char(0xbf); |
|
743 |
utf8 += char(0xbd); |
|
744 |
str = QChar(QChar::ReplacementCharacter); |
|
745 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.3.3") << utf8 << str << -1; |
|
746 |
||
747 |
// 2.3.4 U+0010FFFF |
|
748 |
utf8.clear(); |
|
749 |
utf8 += char(0xf4); |
|
750 |
utf8 += char(0x8f); |
|
751 |
utf8 += char(0xbf); |
|
752 |
utf8 += char(0xbf); |
|
753 |
str.clear(); |
|
754 |
str += QChar(0xdbff); |
|
755 |
str += QChar(0xdfff); |
|
756 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.3.4") << utf8 << str << -1; |
|
757 |
||
758 |
// 2.3.5 U+00110000 |
|
759 |
utf8.clear(); |
|
760 |
utf8 += char(0xf4); |
|
761 |
utf8 += char(0x90); |
|
762 |
utf8 += char(0x80); |
|
763 |
utf8 += char(0x80); |
|
764 |
str.clear(); |
|
765 |
str += QChar(QChar::ReplacementCharacter); |
|
766 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.3.5") << utf8 << str << -1; |
|
767 |
||
768 |
// 3.1.1 |
|
769 |
utf8.clear(); |
|
770 |
utf8 += char(0x80); |
|
771 |
str = fromInvalidUtf8Sequence(utf8); |
|
772 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.1.1") << utf8 << str << -1; |
|
773 |
||
774 |
// 3.1.2 |
|
775 |
utf8.clear(); |
|
776 |
utf8 += char(0xbf); |
|
777 |
str = fromInvalidUtf8Sequence(utf8); |
|
778 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.1.2") << utf8 << str << -1; |
|
779 |
||
780 |
// 3.1.3 |
|
781 |
utf8.clear(); |
|
782 |
utf8 += char(0x80); |
|
783 |
utf8 += char(0xbf); |
|
784 |
str = fromInvalidUtf8Sequence(utf8); |
|
785 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.1.3") << utf8 << str << -1; |
|
786 |
||
787 |
// 3.1.4 |
|
788 |
utf8.clear(); |
|
789 |
utf8 += char(0x80); |
|
790 |
utf8 += char(0xbf); |
|
791 |
utf8 += char(0x80); |
|
792 |
str = fromInvalidUtf8Sequence(utf8); |
|
793 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.1.4") << utf8 << str << -1; |
|
794 |
||
795 |
// 3.1.5 |
|
796 |
utf8.clear(); |
|
797 |
utf8 += char(0x80); |
|
798 |
utf8 += char(0xbf); |
|
799 |
utf8 += char(0x80); |
|
800 |
utf8 += char(0xbf); |
|
801 |
str = fromInvalidUtf8Sequence(utf8); |
|
802 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.1.5") << utf8 << str << -1; |
|
803 |
||
804 |
// 3.1.6 |
|
805 |
utf8.clear(); |
|
806 |
utf8 += char(0x80); |
|
807 |
utf8 += char(0xbf); |
|
808 |
utf8 += char(0x80); |
|
809 |
utf8 += char(0xbf); |
|
810 |
utf8 += char(0x80); |
|
811 |
str = fromInvalidUtf8Sequence(utf8); |
|
812 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.1.6") << utf8 << str << -1; |
|
813 |
||
814 |
// 3.1.7 |
|
815 |
utf8.clear(); |
|
816 |
utf8 += char(0x80); |
|
817 |
utf8 += char(0xbf); |
|
818 |
utf8 += char(0x80); |
|
819 |
utf8 += char(0xbf); |
|
820 |
utf8 += char(0x80); |
|
821 |
utf8 += char(0xbf); |
|
822 |
str = fromInvalidUtf8Sequence(utf8); |
|
823 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.1.7") << utf8 << str << -1; |
|
824 |
||
825 |
// 3.1.8 |
|
826 |
utf8.clear(); |
|
827 |
utf8 += char(0x80); |
|
828 |
utf8 += char(0xbf); |
|
829 |
utf8 += char(0x80); |
|
830 |
utf8 += char(0xbf); |
|
831 |
utf8 += char(0x80); |
|
832 |
utf8 += char(0xbf); |
|
833 |
utf8 += char(0x80); |
|
834 |
str = fromInvalidUtf8Sequence(utf8); |
|
835 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.1.8") << utf8 << str << -1; |
|
836 |
||
837 |
// 3.1.9 |
|
838 |
utf8.clear(); |
|
839 |
for (uint i = 0x80; i<= 0xbf; ++i) |
|
840 |
utf8 += i; |
|
841 |
str = fromInvalidUtf8Sequence(utf8); |
|
842 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.1.9") << utf8 << str << -1; |
|
843 |
||
844 |
// 3.2.1 |
|
845 |
utf8.clear(); |
|
846 |
str.clear(); |
|
847 |
for (uint i = 0xc8; i <= 0xdf; ++i) { |
|
848 |
utf8 += i; |
|
849 |
utf8 += char(0x20); |
|
850 |
||
851 |
str += QChar::ReplacementCharacter; |
|
852 |
str += QChar(0x0020); |
|
853 |
} |
|
854 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.2.1") << utf8 << str << -1; |
|
855 |
||
856 |
// 3.2.2 |
|
857 |
utf8.clear(); |
|
858 |
str.clear(); |
|
859 |
for (uint i = 0xe0; i <= 0xef; ++i) { |
|
860 |
utf8 += i; |
|
861 |
utf8 += char(0x20); |
|
862 |
||
863 |
str += QChar::ReplacementCharacter; |
|
864 |
str += QChar(0x0020); |
|
865 |
} |
|
866 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.2.2") << utf8 << str << -1; |
|
867 |
||
868 |
// 3.2.3 |
|
869 |
utf8.clear(); |
|
870 |
str.clear(); |
|
871 |
for (uint i = 0xf0; i <= 0xf7; ++i) { |
|
872 |
utf8 += i; |
|
873 |
utf8 += 0x20; |
|
874 |
||
875 |
str += QChar::ReplacementCharacter; |
|
876 |
str += QChar(0x0020); |
|
877 |
} |
|
878 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.2.3") << utf8 << str << -1; |
|
879 |
||
880 |
// 3.2.4 |
|
881 |
utf8.clear(); |
|
882 |
str.clear(); |
|
883 |
for (uint i = 0xf8; i <= 0xfb; ++i) { |
|
884 |
utf8 += i; |
|
885 |
utf8 += 0x20; |
|
886 |
||
887 |
str += QChar::ReplacementCharacter; |
|
888 |
str += QChar(0x0020); |
|
889 |
} |
|
890 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.2.4") << utf8 << str << -1; |
|
891 |
||
892 |
// 3.2.5 |
|
893 |
utf8.clear(); |
|
894 |
str.clear(); |
|
895 |
for (uint i = 0xfc; i <= 0xfd; ++i) { |
|
896 |
utf8 += i; |
|
897 |
utf8 += 0x20; |
|
898 |
||
899 |
str += QChar::ReplacementCharacter; |
|
900 |
str += QChar(0x0020); |
|
901 |
} |
|
902 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.2.5") << utf8 << str << -1; |
|
903 |
||
904 |
// 3.3.1 |
|
905 |
utf8.clear(); |
|
906 |
utf8 += char(0xc0); |
|
907 |
str = fromInvalidUtf8Sequence(utf8); |
|
908 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.1") << utf8 << str << -1; |
|
909 |
utf8 += char(0x30); |
|
910 |
str += 0x30; |
|
911 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.1-1") << utf8 << str << -1; |
|
912 |
||
913 |
// 3.3.2 |
|
914 |
utf8.clear(); |
|
915 |
utf8 += char(0xe0); |
|
916 |
utf8 += char(0x80); |
|
917 |
str = fromInvalidUtf8Sequence(utf8); |
|
918 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.2") << utf8 << str << -1; |
|
919 |
utf8 += char(0x30); |
|
920 |
str += 0x30; |
|
921 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.2-1") << utf8 << str << -1; |
|
922 |
||
923 |
utf8.clear(); |
|
924 |
utf8 += char(0xe0); |
|
925 |
str = fromInvalidUtf8Sequence(utf8); |
|
926 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.2-2") << utf8 << str << -1; |
|
927 |
utf8 += 0x30; |
|
928 |
str += 0x30; |
|
929 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.2-3") << utf8 << str << -1; |
|
930 |
||
931 |
// 3.3.3 |
|
932 |
utf8.clear(); |
|
933 |
utf8 += char(0xf0); |
|
934 |
utf8 += char(0x80); |
|
935 |
utf8 += char(0x80); |
|
936 |
str = fromInvalidUtf8Sequence(utf8); |
|
937 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.3") << utf8 << str << -1; |
|
938 |
utf8 += char(0x30); |
|
939 |
str += 0x30; |
|
940 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.3-1") << utf8 << str << -1; |
|
941 |
||
942 |
utf8.clear(); |
|
943 |
utf8 += char(0xf0); |
|
944 |
str = fromInvalidUtf8Sequence(utf8); |
|
945 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.3-2") << utf8 << str << -1; |
|
946 |
utf8 += char(0x30); |
|
947 |
str += 0x30; |
|
948 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.3-3") << utf8 << str << -1; |
|
949 |
||
950 |
utf8.clear(); |
|
951 |
utf8 += char(0xf0); |
|
952 |
utf8 += char(0x80); |
|
953 |
str = fromInvalidUtf8Sequence(utf8); |
|
954 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.3-4") << utf8 << str << -1; |
|
955 |
utf8 += char(0x30); |
|
956 |
str += 0x30; |
|
957 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.3-5") << utf8 << str << -1; |
|
958 |
||
959 |
// 3.3.4 |
|
960 |
utf8.clear(); |
|
961 |
utf8 += char(0xf8); |
|
962 |
utf8 += char(0x80); |
|
963 |
utf8 += char(0x80); |
|
964 |
utf8 += char(0x80); |
|
965 |
str = fromInvalidUtf8Sequence(utf8); |
|
966 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.4") << utf8 << str << -1; |
|
967 |
utf8 += char(0x30); |
|
968 |
str += 0x30; |
|
969 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.4-1") << utf8 << str << -1; |
|
970 |
||
971 |
utf8.clear(); |
|
972 |
utf8 += char(0xf8); |
|
973 |
utf8 += char(0x80); |
|
974 |
utf8 += char(0x80); |
|
975 |
str = fromInvalidUtf8Sequence(utf8); |
|
976 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.4-2") << utf8 << str << -1; |
|
977 |
utf8 += char(0x30); |
|
978 |
str += 0x30; |
|
979 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.4-3") << utf8 << str << -1; |
|
980 |
||
981 |
utf8.clear(); |
|
982 |
utf8 += char(0xf8); |
|
983 |
utf8 += char(0x80); |
|
984 |
str = fromInvalidUtf8Sequence(utf8); |
|
985 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.4-4") << utf8 << str << -1; |
|
986 |
utf8 += char(0x30); |
|
987 |
str += 0x30; |
|
988 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.4-5") << utf8 << str << -1; |
|
989 |
||
990 |
utf8.clear(); |
|
991 |
utf8 += char(0xf8); |
|
992 |
str = fromInvalidUtf8Sequence(utf8); |
|
993 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.4-6") << utf8 << str << -1; |
|
994 |
utf8 += char(0x30); |
|
995 |
str += 0x30; |
|
996 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.4-7") << utf8 << str << -1; |
|
997 |
||
998 |
// 3.3.5 |
|
999 |
utf8.clear(); |
|
1000 |
utf8 += char(0xfc); |
|
1001 |
utf8 += char(0x80); |
|
1002 |
utf8 += char(0x80); |
|
1003 |
utf8 += char(0x80); |
|
1004 |
utf8 += char(0x80); |
|
1005 |
str = fromInvalidUtf8Sequence(utf8); |
|
1006 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.5") << utf8 << str << -1; |
|
1007 |
utf8 += char(0x30); |
|
1008 |
str += 0x30; |
|
1009 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.5-1") << utf8 << str << -1; |
|
1010 |
||
1011 |
utf8.clear(); |
|
1012 |
utf8 += char(0xfc); |
|
1013 |
utf8 += char(0x80); |
|
1014 |
utf8 += char(0x80); |
|
1015 |
utf8 += char(0x80); |
|
1016 |
str = fromInvalidUtf8Sequence(utf8); |
|
1017 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.5-2") << utf8 << str << -1; |
|
1018 |
utf8 += char(0x30); |
|
1019 |
str += 0x30; |
|
1020 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.5-3") << utf8 << str << -1; |
|
1021 |
||
1022 |
utf8.clear(); |
|
1023 |
utf8 += char(0xfc); |
|
1024 |
utf8 += char(0x80); |
|
1025 |
utf8 += char(0x80); |
|
1026 |
str = fromInvalidUtf8Sequence(utf8); |
|
1027 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.5-4") << utf8 << str << -1; |
|
1028 |
utf8 += char(0x30); |
|
1029 |
str += 0x30; |
|
1030 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.5-5") << utf8 << str << -1; |
|
1031 |
||
1032 |
utf8.clear(); |
|
1033 |
utf8 += char(0xfc); |
|
1034 |
utf8 += char(0x80); |
|
1035 |
str = fromInvalidUtf8Sequence(utf8); |
|
1036 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.5-6") << utf8 << str << -1; |
|
1037 |
utf8 += char(0x30); |
|
1038 |
str += 0x30; |
|
1039 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.5-7") << utf8 << str << -1; |
|
1040 |
||
1041 |
utf8.clear(); |
|
1042 |
utf8 += char(0xfc); |
|
1043 |
str = fromInvalidUtf8Sequence(utf8); |
|
1044 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.5-8") << utf8 << str << -1; |
|
1045 |
utf8 += char(0x30); |
|
1046 |
str += 0x30; |
|
1047 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.5-9") << utf8 << str << -1; |
|
1048 |
||
1049 |
// 3.3.6 |
|
1050 |
utf8.clear(); |
|
1051 |
utf8 += char(0xdf); |
|
1052 |
str = fromInvalidUtf8Sequence(utf8); |
|
1053 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.6") << utf8 << str << -1; |
|
1054 |
utf8 += char(0x30); |
|
1055 |
str += 0x30; |
|
1056 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.6-1") << utf8 << str << -1; |
|
1057 |
||
1058 |
// 3.3.7 |
|
1059 |
utf8.clear(); |
|
1060 |
utf8 += char(0xef); |
|
1061 |
utf8 += char(0xbf); |
|
1062 |
str = fromInvalidUtf8Sequence(utf8); |
|
1063 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.7") << utf8 << str << -1; |
|
1064 |
utf8 += char(0x30); |
|
1065 |
str += 0x30; |
|
1066 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.7-1") << utf8 << str << -1; |
|
1067 |
||
1068 |
utf8.clear(); |
|
1069 |
utf8 += char(0xef); |
|
1070 |
str = fromInvalidUtf8Sequence(utf8); |
|
1071 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.7-2") << utf8 << str << -1; |
|
1072 |
utf8 += char(0x30); |
|
1073 |
str += 0x30; |
|
1074 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.7-3") << utf8 << str << -1; |
|
1075 |
||
1076 |
// 3.3.8 |
|
1077 |
utf8.clear(); |
|
1078 |
utf8 += char(0xf7); |
|
1079 |
utf8 += char(0xbf); |
|
1080 |
utf8 += char(0xbf); |
|
1081 |
str = fromInvalidUtf8Sequence(utf8); |
|
1082 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.8") << utf8 << str << -1; |
|
1083 |
utf8 += char(0x30); |
|
1084 |
str += 0x30; |
|
1085 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.8-1") << utf8 << str << -1; |
|
1086 |
||
1087 |
utf8.clear(); |
|
1088 |
utf8 += char(0xf7); |
|
1089 |
utf8 += char(0xbf); |
|
1090 |
str = fromInvalidUtf8Sequence(utf8); |
|
1091 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.8-2") << utf8 << str << -1; |
|
1092 |
utf8 += char(0x30); |
|
1093 |
str += 0x30; |
|
1094 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.8-3") << utf8 << str << -1; |
|
1095 |
||
1096 |
utf8.clear(); |
|
1097 |
utf8 += char(0xf7); |
|
1098 |
str = fromInvalidUtf8Sequence(utf8); |
|
1099 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.8-4") << utf8 << str << -1; |
|
1100 |
utf8 += char(0x30); |
|
1101 |
str += 0x30; |
|
1102 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.8-5") << utf8 << str << -1; |
|
1103 |
||
1104 |
// 3.3.9 |
|
1105 |
utf8.clear(); |
|
1106 |
utf8 += char(0xfb); |
|
1107 |
utf8 += char(0xbf); |
|
1108 |
utf8 += char(0xbf); |
|
1109 |
utf8 += char(0xbf); |
|
1110 |
str = fromInvalidUtf8Sequence(utf8); |
|
1111 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.9") << utf8 << str << -1; |
|
1112 |
utf8 += char(0x30); |
|
1113 |
str += 0x30; |
|
1114 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.9-1") << utf8 << str << -1; |
|
1115 |
||
1116 |
utf8.clear(); |
|
1117 |
utf8 += char(0xfb); |
|
1118 |
utf8 += char(0xbf); |
|
1119 |
utf8 += char(0xbf); |
|
1120 |
str = fromInvalidUtf8Sequence(utf8); |
|
1121 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.9-2") << utf8 << str << -1; |
|
1122 |
utf8 += char(0x30); |
|
1123 |
str += 0x30; |
|
1124 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.9-3") << utf8 << str << -1; |
|
1125 |
||
1126 |
utf8.clear(); |
|
1127 |
utf8 += char(0xfb); |
|
1128 |
utf8 += char(0xbf); |
|
1129 |
str = fromInvalidUtf8Sequence(utf8); |
|
1130 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.9-4") << utf8 << str << -1; |
|
1131 |
utf8 += char(0x30); |
|
1132 |
str += 0x30; |
|
1133 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.9-5") << utf8 << str << -1; |
|
1134 |
||
1135 |
utf8.clear(); |
|
1136 |
utf8 += char(0xfb); |
|
1137 |
str = fromInvalidUtf8Sequence(utf8); |
|
1138 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.9-6") << utf8 << str << -1; |
|
1139 |
utf8 += char(0x30); |
|
1140 |
str += 0x30; |
|
1141 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.9-7") << utf8 << str << -1; |
|
1142 |
||
1143 |
// 3.3.10 |
|
1144 |
utf8.clear(); |
|
1145 |
utf8 += char(0xfd); |
|
1146 |
utf8 += char(0xbf); |
|
1147 |
utf8 += char(0xbf); |
|
1148 |
utf8 += char(0xbf); |
|
1149 |
utf8 += char(0xbf); |
|
1150 |
str = fromInvalidUtf8Sequence(utf8); |
|
1151 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.10") << utf8 << str << -1; |
|
1152 |
utf8 += char(0x30); |
|
1153 |
str += 0x30; |
|
1154 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.10-1") << utf8 << str << -1; |
|
1155 |
||
1156 |
utf8.clear(); |
|
1157 |
utf8 += char(0xfd); |
|
1158 |
utf8 += char(0xbf); |
|
1159 |
utf8 += char(0xbf); |
|
1160 |
utf8 += char(0xbf); |
|
1161 |
str = fromInvalidUtf8Sequence(utf8); |
|
1162 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.10-2") << utf8 << str << -1; |
|
1163 |
utf8 += char(0x30); |
|
1164 |
str += 0x30; |
|
1165 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.10-3") << utf8 << str << -1; |
|
1166 |
||
1167 |
utf8.clear(); |
|
1168 |
utf8 += char(0xfd); |
|
1169 |
utf8 += char(0xbf); |
|
1170 |
utf8 += char(0xbf); |
|
1171 |
str = fromInvalidUtf8Sequence(utf8); |
|
1172 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.10-4") << utf8 << str << -1; |
|
1173 |
utf8 += char(0x30); |
|
1174 |
str += 0x30; |
|
1175 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.10-5") << utf8 << str << -1; |
|
1176 |
||
1177 |
utf8.clear(); |
|
1178 |
utf8 += char(0xfd); |
|
1179 |
utf8 += char(0xbf); |
|
1180 |
str = fromInvalidUtf8Sequence(utf8); |
|
1181 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.10-6") << utf8 << str << -1; |
|
1182 |
utf8 += char(0x30); |
|
1183 |
str += 0x30; |
|
1184 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.10-7") << utf8 << str << -1; |
|
1185 |
||
1186 |
utf8.clear(); |
|
1187 |
utf8 += char(0xfd); |
|
1188 |
str = fromInvalidUtf8Sequence(utf8); |
|
1189 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.10-8") << utf8 << str << -1; |
|
1190 |
utf8 += char(0x30); |
|
1191 |
str += 0x30; |
|
1192 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.3.10-9") << utf8 << str << -1; |
|
1193 |
||
1194 |
// 3.4 |
|
1195 |
utf8.clear(); |
|
1196 |
utf8 += char(0xc0); |
|
1197 |
utf8 += char(0xe0); |
|
1198 |
utf8 += char(0x80); |
|
1199 |
utf8 += char(0xf0); |
|
1200 |
utf8 += char(0x80); |
|
1201 |
utf8 += char(0x80); |
|
1202 |
utf8 += char(0xf8); |
|
1203 |
utf8 += char(0x80); |
|
1204 |
utf8 += char(0x80); |
|
1205 |
utf8 += char(0x80); |
|
1206 |
utf8 += char(0xfc); |
|
1207 |
utf8 += char(0x80); |
|
1208 |
utf8 += char(0x80); |
|
1209 |
utf8 += char(0x80); |
|
1210 |
utf8 += char(0x80); |
|
1211 |
utf8 += char(0xdf); |
|
1212 |
utf8 += char(0xef); |
|
1213 |
utf8 += char(0xbf); |
|
1214 |
utf8 += char(0xf7); |
|
1215 |
utf8 += char(0xbf); |
|
1216 |
utf8 += char(0xbf); |
|
1217 |
utf8 += char(0xfb); |
|
1218 |
utf8 += char(0xbf); |
|
1219 |
utf8 += char(0xbf); |
|
1220 |
utf8 += char(0xbf); |
|
1221 |
utf8 += char(0xfd); |
|
1222 |
utf8 += char(0xbf); |
|
1223 |
utf8 += char(0xbf); |
|
1224 |
utf8 += char(0xbf); |
|
1225 |
utf8 += char(0xbf); |
|
1226 |
str = fromInvalidUtf8Sequence(utf8); |
|
1227 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.4") << utf8 << str << -1; |
|
1228 |
||
1229 |
// 3.5.1 |
|
1230 |
utf8.clear(); |
|
1231 |
utf8 += char(0xfe); |
|
1232 |
str = fromInvalidUtf8Sequence(utf8); |
|
1233 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.5.1") << utf8 << str << -1; |
|
1234 |
||
1235 |
// 3.5.2 |
|
1236 |
utf8.clear(); |
|
1237 |
utf8 += char(0xff); |
|
1238 |
str = fromInvalidUtf8Sequence(utf8); |
|
1239 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.5.1") << utf8 << str << -1; |
|
1240 |
||
1241 |
// 3.5.2 |
|
1242 |
utf8.clear(); |
|
1243 |
utf8 += char(0xfe); |
|
1244 |
utf8 += char(0xfe); |
|
1245 |
utf8 += char(0xff); |
|
1246 |
str = fromInvalidUtf8Sequence(utf8); |
|
1247 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.5.1") << utf8 << str << -1; |
|
1248 |
||
1249 |
// 4.1.1 |
|
1250 |
utf8.clear(); |
|
1251 |
utf8 += char(0xc0); |
|
1252 |
utf8 += char(0xaf); |
|
1253 |
str = QChar(QChar::ReplacementCharacter); |
|
1254 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 4.1.1") << utf8 << str << -1; |
|
1255 |
||
1256 |
// 4.1.2 |
|
1257 |
utf8.clear(); |
|
1258 |
utf8 += char(0xe0); |
|
1259 |
utf8 += char(0x80); |
|
1260 |
utf8 += char(0xaf); |
|
1261 |
str = QChar(QChar::ReplacementCharacter); |
|
1262 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 4.1.2") << utf8 << str << -1; |
|
1263 |
||
1264 |
// 4.1.3 |
|
1265 |
utf8.clear(); |
|
1266 |
utf8 += char(0xf0); |
|
1267 |
utf8 += char(0x80); |
|
1268 |
utf8 += char(0x80); |
|
1269 |
utf8 += char(0xaf); |
|
1270 |
str = QChar(QChar::ReplacementCharacter); |
|
1271 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 4.1.3") << utf8 << str << -1; |
|
1272 |
||
1273 |
// 4.1.4 |
|
1274 |
utf8.clear(); |
|
1275 |
utf8 += char(0xf8); |
|
1276 |
utf8 += char(0x80); |
|
1277 |
utf8 += char(0x80); |
|
1278 |
utf8 += char(0x80); |
|
1279 |
utf8 += char(0xaf); |
|
1280 |
str = fromInvalidUtf8Sequence(utf8); |
|
1281 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 4.1.4") << utf8 << str << -1; |
|
1282 |
||
1283 |
// 4.1.5 |
|
1284 |
utf8.clear(); |
|
1285 |
utf8 += char(0xfc); |
|
1286 |
utf8 += char(0x80); |
|
1287 |
utf8 += char(0x80); |
|
1288 |
utf8 += char(0x80); |
|
1289 |
utf8 += char(0x80); |
|
1290 |
utf8 += char(0xaf); |
|
1291 |
str = fromInvalidUtf8Sequence(utf8); |
|
1292 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 4.1.5") << utf8 << str << -1; |
|
1293 |
||
1294 |
// 4.2.1 |
|
1295 |
utf8.clear(); |
|
1296 |
utf8 += char(0xc1); |
|
1297 |
utf8 += char(0xbf); |
|
1298 |
str = QChar(QChar::ReplacementCharacter); |
|
1299 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 4.2.1") << utf8 << str << -1; |
|
1300 |
||
1301 |
// 4.2.2 |
|
1302 |
utf8.clear(); |
|
1303 |
utf8 += char(0xe0); |
|
1304 |
utf8 += char(0x9f); |
|
1305 |
utf8 += char(0xbf); |
|
1306 |
str = QChar(QChar::ReplacementCharacter); |
|
1307 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 4.2.2") << utf8 << str << -1; |
|
1308 |
||
1309 |
// 4.2.3 |
|
1310 |
utf8.clear(); |
|
1311 |
utf8 += char(0xf0); |
|
1312 |
utf8 += char(0x8f); |
|
1313 |
utf8 += char(0xbf); |
|
1314 |
utf8 += char(0xbf); |
|
1315 |
str = QChar(QChar::ReplacementCharacter); |
|
1316 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 4.2.3") << utf8 << str << -1; |
|
1317 |
||
1318 |
// 4.2.4 |
|
1319 |
utf8.clear(); |
|
1320 |
utf8 += char(0xf8); |
|
1321 |
utf8 += char(0x87); |
|
1322 |
utf8 += char(0xbf); |
|
1323 |
utf8 += char(0xbf); |
|
1324 |
utf8 += char(0xbf); |
|
1325 |
str = fromInvalidUtf8Sequence(utf8); |
|
1326 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 4.2.4") << utf8 << str << -1; |
|
1327 |
||
1328 |
// 4.2.5 |
|
1329 |
utf8.clear(); |
|
1330 |
utf8 += char(0xfc); |
|
1331 |
utf8 += char(0x83); |
|
1332 |
utf8 += char(0xbf); |
|
1333 |
utf8 += char(0xbf); |
|
1334 |
utf8 += char(0xbf); |
|
1335 |
utf8 += char(0xbf); |
|
1336 |
str = fromInvalidUtf8Sequence(utf8); |
|
1337 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 4.2.5") << utf8 << str << -1; |
|
1338 |
||
1339 |
// 4.3.1 |
|
1340 |
utf8.clear(); |
|
1341 |
utf8 += char(0xc0); |
|
1342 |
utf8 += char(0x80); |
|
1343 |
str = QChar(QChar::ReplacementCharacter); |
|
1344 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 4.3.1") << utf8 << str << -1; |
|
1345 |
||
1346 |
// 4.3.2 |
|
1347 |
utf8.clear(); |
|
1348 |
utf8 += char(0xe0); |
|
1349 |
utf8 += char(0x80); |
|
1350 |
utf8 += char(0x80); |
|
1351 |
str = QChar(QChar::ReplacementCharacter); |
|
1352 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 4.3.2") << utf8 << str << -1; |
|
1353 |
||
1354 |
// 4.3.3 |
|
1355 |
utf8.clear(); |
|
1356 |
utf8 += char(0xf0); |
|
1357 |
utf8 += char(0x80); |
|
1358 |
utf8 += char(0x80); |
|
1359 |
utf8 += char(0x80); |
|
1360 |
str = QChar(QChar::ReplacementCharacter); |
|
1361 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 4.3.3") << utf8 << str << -1; |
|
1362 |
||
1363 |
// 4.3.4 |
|
1364 |
utf8.clear(); |
|
1365 |
utf8 += char(0xf8); |
|
1366 |
utf8 += char(0x80); |
|
1367 |
utf8 += char(0x80); |
|
1368 |
utf8 += char(0x80); |
|
1369 |
utf8 += char(0x80); |
|
1370 |
str = fromInvalidUtf8Sequence(utf8); |
|
1371 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 4.3.4") << utf8 << str << -1; |
|
1372 |
||
1373 |
// 4.3.5 |
|
1374 |
utf8.clear(); |
|
1375 |
utf8 += char(0xfc); |
|
1376 |
utf8 += char(0x80); |
|
1377 |
utf8 += char(0x80); |
|
1378 |
utf8 += char(0x80); |
|
1379 |
utf8 += char(0x80); |
|
1380 |
utf8 += char(0x80); |
|
1381 |
str = fromInvalidUtf8Sequence(utf8); |
|
1382 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 4.3.5") << utf8 << str << -1; |
|
1383 |
||
1384 |
// 5.1.1 |
|
1385 |
utf8.clear(); |
|
1386 |
utf8 += char(0xed); |
|
1387 |
utf8 += char(0xa0); |
|
1388 |
utf8 += char(0x80); |
|
1389 |
str = QChar(QChar::ReplacementCharacter); |
|
1390 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 5.1.1") << utf8 << str << -1; |
|
1391 |
||
1392 |
// 5.1.2 |
|
1393 |
utf8.clear(); |
|
1394 |
utf8 += char(0xed); |
|
1395 |
utf8 += char(0xad); |
|
1396 |
utf8 += char(0xbf); |
|
1397 |
str = QChar(QChar::ReplacementCharacter); |
|
1398 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 5.1.2") << utf8 << str << -1; |
|
1399 |
||
1400 |
// 5.1.3 |
|
1401 |
utf8.clear(); |
|
1402 |
utf8 += char(0xed); |
|
1403 |
utf8 += char(0xae); |
|
1404 |
utf8 += char(0x80); |
|
1405 |
str = QChar(QChar::ReplacementCharacter); |
|
1406 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 5.1.3") << utf8 << str << -1; |
|
1407 |
||
1408 |
// 5.1.4 |
|
1409 |
utf8.clear(); |
|
1410 |
utf8 += char(0xed); |
|
1411 |
utf8 += char(0xaf); |
|
1412 |
utf8 += char(0xbf); |
|
1413 |
str = QChar(QChar::ReplacementCharacter); |
|
1414 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 5.1.4") << utf8 << str << -1; |
|
1415 |
||
1416 |
// 5.1.5 |
|
1417 |
utf8.clear(); |
|
1418 |
utf8 += char(0xed); |
|
1419 |
utf8 += char(0xb0); |
|
1420 |
utf8 += char(0x80); |
|
1421 |
str = QChar(QChar::ReplacementCharacter); |
|
1422 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 5.1.5") << utf8 << str << -1; |
|
1423 |
||
1424 |
// 5.1.6 |
|
1425 |
utf8.clear(); |
|
1426 |
utf8 += char(0xed); |
|
1427 |
utf8 += char(0xbe); |
|
1428 |
utf8 += char(0x80); |
|
1429 |
str = QChar(QChar::ReplacementCharacter); |
|
1430 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 5.1.6") << utf8 << str << -1; |
|
1431 |
||
1432 |
// 5.1.7 |
|
1433 |
utf8.clear(); |
|
1434 |
utf8 += char(0xed); |
|
1435 |
utf8 += char(0xbf); |
|
1436 |
utf8 += char(0xbf); |
|
1437 |
str = QChar(QChar::ReplacementCharacter); |
|
1438 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 5.1.7") << utf8 << str << -1; |
|
1439 |
||
1440 |
// 5.2.1 |
|
1441 |
utf8.clear(); |
|
1442 |
utf8 += char(0xed); |
|
1443 |
utf8 += char(0xa0); |
|
1444 |
utf8 += char(0x80); |
|
1445 |
utf8 += char(0xed); |
|
1446 |
utf8 += char(0xb0); |
|
1447 |
utf8 += char(0x80); |
|
1448 |
str.clear(); |
|
1449 |
str += QChar(QChar::ReplacementCharacter); |
|
1450 |
str += QChar(QChar::ReplacementCharacter); |
|
1451 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 5.2.1") << utf8 << str << -1; |
|
1452 |
||
1453 |
// 5.2.2 |
|
1454 |
utf8.clear(); |
|
1455 |
utf8 += char(0xed); |
|
1456 |
utf8 += char(0xa0); |
|
1457 |
utf8 += char(0x80); |
|
1458 |
utf8 += char(0xed); |
|
1459 |
utf8 += char(0xbf); |
|
1460 |
utf8 += char(0xbf); |
|
1461 |
str.clear(); |
|
1462 |
str += QChar(QChar::ReplacementCharacter); |
|
1463 |
str += QChar(QChar::ReplacementCharacter); |
|
1464 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 5.2.2") << utf8 << str << -1; |
|
1465 |
||
1466 |
// 5.2.3 |
|
1467 |
utf8.clear(); |
|
1468 |
utf8 += char(0xed); |
|
1469 |
utf8 += char(0xad); |
|
1470 |
utf8 += char(0xbf); |
|
1471 |
utf8 += char(0xed); |
|
1472 |
utf8 += char(0xb0); |
|
1473 |
utf8 += char(0x80); |
|
1474 |
str.clear(); |
|
1475 |
str += QChar(QChar::ReplacementCharacter); |
|
1476 |
str += QChar(QChar::ReplacementCharacter); |
|
1477 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 5.2.3") << utf8 << str << -1; |
|
1478 |
||
1479 |
// 5.2.4 |
|
1480 |
utf8.clear(); |
|
1481 |
utf8 += char(0xed); |
|
1482 |
utf8 += char(0xad); |
|
1483 |
utf8 += char(0xbf); |
|
1484 |
utf8 += char(0xed); |
|
1485 |
utf8 += char(0xbf); |
|
1486 |
utf8 += char(0xbf); |
|
1487 |
str.clear(); |
|
1488 |
str += QChar(QChar::ReplacementCharacter); |
|
1489 |
str += QChar(QChar::ReplacementCharacter); |
|
1490 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 5.2.4") << utf8 << str << -1; |
|
1491 |
||
1492 |
// 5.2.5 |
|
1493 |
utf8.clear(); |
|
1494 |
utf8 += char(0xed); |
|
1495 |
utf8 += char(0xae); |
|
1496 |
utf8 += char(0x80); |
|
1497 |
utf8 += char(0xed); |
|
1498 |
utf8 += char(0xb0); |
|
1499 |
utf8 += char(0x80); |
|
1500 |
str.clear(); |
|
1501 |
str += QChar(QChar::ReplacementCharacter); |
|
1502 |
str += QChar(QChar::ReplacementCharacter); |
|
1503 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 5.2.5") << utf8 << str << -1; |
|
1504 |
||
1505 |
// 5.2.6 |
|
1506 |
utf8.clear(); |
|
1507 |
utf8 += char(0xed); |
|
1508 |
utf8 += char(0xae); |
|
1509 |
utf8 += char(0x80); |
|
1510 |
utf8 += char(0xed); |
|
1511 |
utf8 += char(0xbf); |
|
1512 |
utf8 += char(0xbf); |
|
1513 |
str.clear(); |
|
1514 |
str += QChar(QChar::ReplacementCharacter); |
|
1515 |
str += QChar(QChar::ReplacementCharacter); |
|
1516 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 5.2.6") << utf8 << str << -1; |
|
1517 |
||
1518 |
// 5.2.7 |
|
1519 |
utf8.clear(); |
|
1520 |
utf8 += char(0xed); |
|
1521 |
utf8 += char(0xaf); |
|
1522 |
utf8 += char(0xbf); |
|
1523 |
utf8 += char(0xed); |
|
1524 |
utf8 += char(0xb0); |
|
1525 |
utf8 += char(0x80); |
|
1526 |
str.clear(); |
|
1527 |
str += QChar(QChar::ReplacementCharacter); |
|
1528 |
str += QChar(QChar::ReplacementCharacter); |
|
1529 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 5.2.7") << utf8 << str << -1; |
|
1530 |
||
1531 |
// 5.2.8 |
|
1532 |
utf8.clear(); |
|
1533 |
utf8 += char(0xed); |
|
1534 |
utf8 += char(0xaf); |
|
1535 |
utf8 += char(0xbf); |
|
1536 |
utf8 += char(0xed); |
|
1537 |
utf8 += char(0xbf); |
|
1538 |
utf8 += char(0xbf); |
|
1539 |
str.clear(); |
|
1540 |
str += QChar(QChar::ReplacementCharacter); |
|
1541 |
str += QChar(QChar::ReplacementCharacter); |
|
1542 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 5.2.8") << utf8 << str << -1; |
|
1543 |
||
1544 |
// 5.3.1 |
|
1545 |
utf8.clear(); |
|
1546 |
utf8 += char(0xef); |
|
1547 |
utf8 += char(0xbf); |
|
1548 |
utf8 += char(0xbe); |
|
1549 |
str = QChar(QChar::ReplacementCharacter); |
|
1550 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 5.3.1") << utf8 << str << -1; |
|
1551 |
||
1552 |
// 5.3.2 |
|
1553 |
utf8.clear(); |
|
1554 |
utf8 += char(0xef); |
|
1555 |
utf8 += char(0xbf); |
|
1556 |
utf8 += char(0xbf); |
|
1557 |
str = QChar(QChar::ReplacementCharacter); |
|
1558 |
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 5.3.2") << utf8 << str << -1; |
|
1559 |
} |
|
1560 |
||
1561 |
void tst_QTextCodec::utf8Codec() |
|
1562 |
{ |
|
1563 |
QTextCodec *codec = QTextCodec::codecForMib(106); // UTF-8 |
|
1564 |
QVERIFY(codec != 0); |
|
1565 |
||
1566 |
QFETCH(QByteArray, utf8); |
|
1567 |
QFETCH(QString, res); |
|
1568 |
QFETCH(int, len); |
|
1569 |
||
1570 |
QString str = codec->toUnicode(utf8.isNull() ? 0 : utf8.constData(), |
|
1571 |
len < 0 ? qstrlen(utf8.constData()) : len); |
|
1572 |
QCOMPARE(str, res); |
|
1573 |
||
1574 |
str = QString::fromUtf8(utf8.isNull() ? 0 : utf8.constData(), len); |
|
1575 |
QCOMPARE(str, res); |
|
1576 |
} |
|
1577 |
||
1578 |
void tst_QTextCodec::utf8bom_data() |
|
1579 |
{ |
|
1580 |
QTest::addColumn<QByteArray>("data"); |
|
1581 |
QTest::addColumn<QString>("result"); |
|
1582 |
||
1583 |
QTest::newRow("nobom") |
|
1584 |
<< QByteArray("\302\240", 2) |
|
1585 |
<< QString("\240"); |
|
1586 |
||
1587 |
{ |
|
1588 |
static const ushort data[] = { 0x201d }; |
|
1589 |
QTest::newRow("nobom 2") |
|
1590 |
<< QByteArray("\342\200\235", 3) |
|
1591 |
<< QString::fromUtf16(data, sizeof(data)/sizeof(short)); |
|
1592 |
} |
|
1593 |
||
1594 |
{ |
|
1595 |
static const ushort data[] = { 0xf000 }; |
|
1596 |
QTest::newRow("bom1") |
|
1597 |
<< QByteArray("\357\200\200", 3) |
|
1598 |
<< QString::fromUtf16(data, sizeof(data)/sizeof(short)); |
|
1599 |
} |
|
1600 |
||
1601 |
{ |
|
1602 |
static const ushort data[] = { 0xfec0 }; |
|
1603 |
QTest::newRow("bom2") |
|
1604 |
<< QByteArray("\357\273\200", 3) |
|
1605 |
<< QString::fromUtf16(data, sizeof(data)/sizeof(short)); |
|
1606 |
} |
|
1607 |
||
1608 |
{ |
|
1609 |
QTest::newRow("normal-bom") |
|
1610 |
<< QByteArray("\357\273\277a", 4) |
|
1611 |
<< QString("a"); |
|
1612 |
} |
|
1613 |
||
1614 |
{ |
|
1615 |
static const ushort data[] = { 0x61, 0xfeff, 0x62 }; |
|
1616 |
QTest::newRow("middle-bom") |
|
1617 |
<< QByteArray("a\357\273\277b", 5) |
|
1618 |
<< QString::fromUtf16(data, sizeof(data)/sizeof(short)); |
|
1619 |
} |
|
1620 |
} |
|
1621 |
||
1622 |
void tst_QTextCodec::utf8bom() |
|
1623 |
{ |
|
1624 |
QFETCH(QByteArray, data); |
|
1625 |
QFETCH(QString, result); |
|
1626 |
||
1627 |
QTextCodec *const codec = QTextCodec::codecForMib(106); // UTF-8 |
|
1628 |
Q_ASSERT(codec); |
|
1629 |
||
1630 |
QCOMPARE(codec->toUnicode(data.constData(), data.length(), 0), result); |
|
1631 |
||
1632 |
QTextCodec::ConverterState state; |
|
1633 |
QCOMPARE(codec->toUnicode(data.constData(), data.length(), &state), result); |
|
1634 |
} |
|
1635 |
||
1636 |
void tst_QTextCodec::utfHeaders_data() |
|
1637 |
{ |
|
1638 |
QTest::addColumn<QByteArray>("codecName"); |
|
1639 |
QTest::addColumn<int>("flags"); |
|
1640 |
QTest::addColumn<QByteArray>("encoded"); |
|
1641 |
QTest::addColumn<QString>("unicode"); |
|
1642 |
QTest::addColumn<bool>("toUnicode"); |
|
1643 |
||
1644 |
QTest::newRow("utf8 bom") |
|
1645 |
<< QByteArray("UTF-8") |
|
1646 |
<< 0 |
|
1647 |
<< QByteArray("\xef\xbb\xbfhello") |
|
1648 |
<< QString::fromLatin1("hello") |
|
1649 |
<< true; |
|
1650 |
QTest::newRow("utf8 nobom") |
|
1651 |
<< QByteArray("UTF-8") |
|
1652 |
<< 0 |
|
1653 |
<< QByteArray("hello") |
|
1654 |
<< QString::fromLatin1("hello") |
|
1655 |
<< true; |
|
1656 |
QTest::newRow("utf8 bom ignore header") |
|
1657 |
<< QByteArray("UTF-8") |
|
1658 |
<< (int)QTextCodec::IgnoreHeader |
|
1659 |
<< QByteArray("\xef\xbb\xbfhello") |
|
1660 |
<< (QString(QChar(0xfeff)) + QString::fromLatin1("hello")) |
|
1661 |
<< true; |
|
1662 |
QTest::newRow("utf8 nobom ignore header") |
|
1663 |
<< QByteArray("UTF-8") |
|
1664 |
<< (int)QTextCodec::IgnoreHeader |
|
1665 |
<< QByteArray("hello") |
|
1666 |
<< QString::fromLatin1("hello") |
|
1667 |
<< true; |
|
1668 |
||
1669 |
QTest::newRow("utf16 bom be") |
|
1670 |
<< QByteArray("UTF-16") |
|
1671 |
<< 0 |
|
1672 |
<< QByteArray("\xfe\xff\0h\0e\0l", 8) |
|
1673 |
<< QString::fromLatin1("hel") |
|
1674 |
<< true; |
|
1675 |
QTest::newRow("utf16 bom le") |
|
1676 |
<< QByteArray("UTF-16") |
|
1677 |
<< 0 |
|
1678 |
<< QByteArray("\xff\xfeh\0e\0l\0", 8) |
|
1679 |
<< QString::fromLatin1("hel") |
|
1680 |
<< true; |
|
1681 |
if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { |
|
1682 |
QTest::newRow("utf16 nobom") |
|
1683 |
<< QByteArray("UTF-16") |
|
1684 |
<< 0 |
|
1685 |
<< QByteArray("\0h\0e\0l", 6) |
|
1686 |
<< QString::fromLatin1("hel") |
|
1687 |
<< true; |
|
1688 |
QTest::newRow("utf16 bom be ignore header") |
|
1689 |
<< QByteArray("UTF-16") |
|
1690 |
<< (int)QTextCodec::IgnoreHeader |
|
1691 |
<< QByteArray("\xfe\xff\0h\0e\0l", 8) |
|
1692 |
<< (QString(QChar(0xfeff)) + QString::fromLatin1("hel")) |
|
1693 |
<< true; |
|
1694 |
} else { |
|
1695 |
QTest::newRow("utf16 nobom") |
|
1696 |
<< QByteArray("UTF-16") |
|
1697 |
<< 0 |
|
1698 |
<< QByteArray("h\0e\0l\0", 6) |
|
1699 |
<< QString::fromLatin1("hel") |
|
1700 |
<< true; |
|
1701 |
QTest::newRow("utf16 bom le ignore header") |
|
1702 |
<< QByteArray("UTF-16") |
|
1703 |
<< (int)QTextCodec::IgnoreHeader |
|
1704 |
<< QByteArray("\xff\xfeh\0e\0l\0", 8) |
|
1705 |
<< (QString(QChar(0xfeff)) + QString::fromLatin1("hel")) |
|
1706 |
<< true; |
|
1707 |
} |
|
1708 |
||
1709 |
QTest::newRow("utf16-be bom be") |
|
1710 |
<< QByteArray("UTF-16BE") |
|
1711 |
<< 0 |
|
1712 |
<< QByteArray("\xfe\xff\0h\0e\0l", 8) |
|
1713 |
<< QString::fromLatin1("hel") |
|
1714 |
<< true; |
|
1715 |
QTest::newRow("utf16-be nobom") |
|
1716 |
<< QByteArray("UTF-16BE") |
|
1717 |
<< 0 |
|
1718 |
<< QByteArray("\0h\0e\0l", 6) |
|
1719 |
<< QString::fromLatin1("hel") |
|
1720 |
<< true; |
|
1721 |
QTest::newRow("utf16-be bom be ignore header") |
|
1722 |
<< QByteArray("UTF-16BE") |
|
1723 |
<< (int)QTextCodec::IgnoreHeader |
|
1724 |
<< QByteArray("\xfe\xff\0h\0e\0l", 8) |
|
1725 |
<< (QString(QChar(0xfeff)) + QString::fromLatin1("hel")) |
|
1726 |
<< true; |
|
1727 |
||
1728 |
QTest::newRow("utf16-le bom le") |
|
1729 |
<< QByteArray("UTF-16LE") |
|
1730 |
<< 0 |
|
1731 |
<< QByteArray("\xff\xfeh\0e\0l\0", 8) |
|
1732 |
<< QString::fromLatin1("hel") |
|
1733 |
<< true; |
|
1734 |
QTest::newRow("utf16-le nobom") |
|
1735 |
<< QByteArray("UTF-16LE") |
|
1736 |
<< 0 |
|
1737 |
<< QByteArray("h\0e\0l\0", 6) |
|
1738 |
<< QString::fromLatin1("hel") |
|
1739 |
<< true; |
|
1740 |
QTest::newRow("utf16-le bom le ignore header") |
|
1741 |
<< QByteArray("UTF-16LE") |
|
1742 |
<< (int)QTextCodec::IgnoreHeader |
|
1743 |
<< QByteArray("\xff\xfeh\0e\0l\0", 8) |
|
1744 |
<< (QString(QChar(0xfeff)) + QString::fromLatin1("hel")) |
|
1745 |
<< true; |
|
1746 |
||
1747 |
||
1748 |
QTest::newRow("utf32 bom be") |
|
1749 |
<< QByteArray("UTF-32") |
|
1750 |
<< 0 |
|
1751 |
<< QByteArray("\0\0\xfe\xff\0\0\0h\0\0\0e\0\0\0l", 16) |
|
1752 |
<< QString::fromLatin1("hel") |
|
1753 |
<< true; |
|
1754 |
QTest::newRow("utf32 bom le") |
|
1755 |
<< QByteArray("UTF-32") |
|
1756 |
<< 0 |
|
1757 |
<< QByteArray("\xff\xfe\0\0h\0\0\0e\0\0\0l\0\0\0", 16) |
|
1758 |
<< QString::fromLatin1("hel") |
|
1759 |
<< true; |
|
1760 |
if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { |
|
1761 |
QTest::newRow("utf32 nobom") |
|
1762 |
<< QByteArray("UTF-32") |
|
1763 |
<< 0 |
|
1764 |
<< QByteArray("\0\0\0h\0\0\0e\0\0\0l", 12) |
|
1765 |
<< QString::fromLatin1("hel") |
|
1766 |
<< true; |
|
1767 |
QTest::newRow("utf32 bom be ignore header") |
|
1768 |
<< QByteArray("UTF-32") |
|
1769 |
<< (int)QTextCodec::IgnoreHeader |
|
1770 |
<< QByteArray("\0\0\xfe\xff\0\0\0h\0\0\0e\0\0\0l", 16) |
|
1771 |
<< (QString(QChar(0xfeff)) + QString::fromLatin1("hel")) |
|
1772 |
<< true; |
|
1773 |
} else { |
|
1774 |
QTest::newRow("utf32 nobom") |
|
1775 |
<< QByteArray("UTF-32") |
|
1776 |
<< 0 |
|
1777 |
<< QByteArray("h\0\0\0e\0\0\0l\0\0\0", 12) |
|
1778 |
<< QString::fromLatin1("hel") |
|
1779 |
<< true; |
|
1780 |
QTest::newRow("utf32 bom le ignore header") |
|
1781 |
<< QByteArray("UTF-32") |
|
1782 |
<< (int)QTextCodec::IgnoreHeader |
|
1783 |
<< QByteArray("\xff\xfe\0\0h\0\0\0e\0\0\0l\0\0\0", 16) |
|
1784 |
<< (QString(QChar(0xfeff)) + QString::fromLatin1("hel")) |
|
1785 |
<< true; |
|
1786 |
} |
|
1787 |
||
1788 |
||
1789 |
QTest::newRow("utf32-be bom be") |
|
1790 |
<< QByteArray("UTF-32BE") |
|
1791 |
<< 0 |
|
1792 |
<< QByteArray("\0\0\xfe\xff\0\0\0h\0\0\0e\0\0\0l", 16) |
|
1793 |
<< QString::fromLatin1("hel") |
|
1794 |
<< true; |
|
1795 |
QTest::newRow("utf32-be nobom") |
|
1796 |
<< QByteArray("UTF-32BE") |
|
1797 |
<< 0 |
|
1798 |
<< QByteArray("\0\0\0h\0\0\0e\0\0\0l", 12) |
|
1799 |
<< QString::fromLatin1("hel") |
|
1800 |
<< true; |
|
1801 |
QTest::newRow("utf32-be bom be ignore header") |
|
1802 |
<< QByteArray("UTF-32BE") |
|
1803 |
<< (int)QTextCodec::IgnoreHeader |
|
1804 |
<< QByteArray("\0\0\xfe\xff\0\0\0h\0\0\0e\0\0\0l", 16) |
|
1805 |
<< (QString(QChar(0xfeff)) + QString::fromLatin1("hel")) |
|
1806 |
<< true; |
|
1807 |
||
1808 |
||
1809 |
QTest::newRow("utf32-le bom le") |
|
1810 |
<< QByteArray("UTF-32LE") |
|
1811 |
<< 0 |
|
1812 |
<< QByteArray("\xff\xfe\0\0h\0\0\0e\0\0\0l\0\0\0", 16) |
|
1813 |
<< QString::fromLatin1("hel") |
|
1814 |
<< true; |
|
1815 |
QTest::newRow("utf32-le nobom") |
|
1816 |
<< QByteArray("UTF-32LE") |
|
1817 |
<< 0 |
|
1818 |
<< QByteArray("h\0\0\0e\0\0\0l\0\0\0", 12) |
|
1819 |
<< QString::fromLatin1("hel") |
|
1820 |
<< true; |
|
1821 |
QTest::newRow("utf32-le bom le ignore header") |
|
1822 |
<< QByteArray("UTF-32LE") |
|
1823 |
<< (int)QTextCodec::IgnoreHeader |
|
1824 |
<< QByteArray("\xff\xfe\0\0h\0\0\0e\0\0\0l\0\0\0", 16) |
|
1825 |
<< (QString(QChar(0xfeff)) + QString::fromLatin1("hel")) |
|
1826 |
<< true; |
|
1827 |
} |
|
1828 |
||
1829 |
void tst_QTextCodec::utfHeaders() |
|
1830 |
{ |
|
1831 |
QFETCH(QByteArray, codecName); |
|
1832 |
QTextCodec *codec = QTextCodec::codecForName(codecName); |
|
1833 |
QVERIFY(codec != 0); |
|
1834 |
||
1835 |
QFETCH(int, flags); |
|
1836 |
QTextCodec::ConversionFlags cFlags = QTextCodec::ConversionFlags(flags); |
|
1837 |
QTextCodec::ConverterState state(cFlags); |
|
1838 |
||
1839 |
QFETCH(QByteArray, encoded); |
|
1840 |
QFETCH(QString, unicode); |
|
1841 |
||
1842 |
QFETCH(bool, toUnicode); |
|
1843 |
||
1844 |
QLatin1String ignoreReverseTestOn = (QSysInfo::ByteOrder == QSysInfo::BigEndian) ? QLatin1String(" le") : QLatin1String(" be"); |
|
1845 |
QString rowName(QTest::currentDataTag()); |
|
1846 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1847 |
/*for (int i = 0; i < encoded.length(); ++i) |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1848 |
qDebug() << hex << " " << (uint)(uchar)encoded.at(i);*/ |
0 | 1849 |
if (toUnicode) { |
1850 |
QString result = codec->toUnicode(encoded.constData(), encoded.length(), &state); |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1851 |
/*for (int i = 0; i < result.length(); ++i) |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1852 |
qDebug() << hex << " " << (uint)result.at(i).unicode();*/ |
0 | 1853 |
QCOMPARE(result.length(), unicode.length()); |
1854 |
QCOMPARE(result, unicode); |
|
1855 |
||
1856 |
if (!rowName.endsWith("nobom") && !rowName.contains(ignoreReverseTestOn)) { |
|
1857 |
QTextCodec::ConverterState state2(cFlags); |
|
1858 |
QByteArray reencoded = codec->fromUnicode(unicode.unicode(), unicode.length(), &state2); |
|
1859 |
QCOMPARE(reencoded, encoded); |
|
1860 |
} |
|
1861 |
} else { |
|
1862 |
QByteArray result = codec->fromUnicode(unicode.unicode(), unicode.length(), &state); |
|
1863 |
QCOMPARE(result, encoded); |
|
1864 |
} |
|
1865 |
} |
|
1866 |
||
1867 |
void tst_QTextCodec::codecForHtml() |
|
1868 |
{ |
|
1869 |
QByteArray html("<html><head></head><body>blah</body></html>"); |
|
1870 |
||
1871 |
QCOMPARE(QTextCodec::codecForHtml(html)->mibEnum(), 4); // latin 1 |
|
1872 |
||
1873 |
QCOMPARE(QTextCodec::codecForHtml(html, QTextCodec::codecForMib(106))->mibEnum(), 106); // UTF-8 |
|
1874 |
||
1875 |
html = "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859-15\" /></head></html>"; |
|
1876 |
QCOMPARE(QTextCodec::codecForHtml(html, QTextCodec::codecForMib(106))->mibEnum(), 111); // latin 15 |
|
1877 |
||
1878 |
html = "<html><head><meta content=\"text/html; charset=ISO-8859-15\" http-equiv=\"content-type\" /></head></html>"; |
|
1879 |
QCOMPARE(QTextCodec::codecForHtml(html, QTextCodec::codecForMib(106))->mibEnum(), 111); // latin 15 |
|
1880 |
||
1881 |
html = "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=invalid-foo\" /></head></html>"; |
|
1882 |
QCOMPARE(QTextCodec::codecForHtml(html, QTextCodec::codecForMib(106))->mibEnum(), 106); // UTF-8 |
|
1883 |
QCOMPARE(QTextCodec::codecForHtml(html)->mibEnum(), 4); // latin 1 |
|
1884 |
} |
|
1885 |
||
1886 |
void tst_QTextCodec::codecForUtfText_data() |
|
1887 |
{ |
|
1888 |
QTest::addColumn<QByteArray>("encoded"); |
|
1889 |
QTest::addColumn<bool>("detected"); |
|
1890 |
QTest::addColumn<int>("mib"); |
|
1891 |
||
1892 |
||
1893 |
QTest::newRow("utf8 bom") |
|
1894 |
<< QByteArray("\xef\xbb\xbfhello") |
|
1895 |
<< true |
|
1896 |
<< 106; |
|
1897 |
QTest::newRow("utf8 nobom") |
|
1898 |
<< QByteArray("hello") |
|
1899 |
<< false |
|
1900 |
<< 0; |
|
1901 |
||
1902 |
QTest::newRow("utf16 bom be") |
|
1903 |
<< QByteArray("\xfe\xff\0h\0e\0l", 8) |
|
1904 |
<< true |
|
1905 |
<< 1013; |
|
1906 |
QTest::newRow("utf16 bom le") |
|
1907 |
<< QByteArray("\xff\xfeh\0e\0l\0", 8) |
|
1908 |
<< true |
|
1909 |
<< 1014; |
|
1910 |
QTest::newRow("utf16 nobom") |
|
1911 |
<< QByteArray("\0h\0e\0l", 6) |
|
1912 |
<< false |
|
1913 |
<< 0; |
|
1914 |
||
1915 |
QTest::newRow("utf32 bom be") |
|
1916 |
<< QByteArray("\0\0\xfe\xff\0\0\0h\0\0\0e\0\0\0l", 16) |
|
1917 |
<< true |
|
1918 |
<< 1018; |
|
1919 |
QTest::newRow("utf32 bom le") |
|
1920 |
<< QByteArray("\xff\xfe\0\0h\0\0\0e\0\0\0l\0\0\0", 16) |
|
1921 |
<< true |
|
1922 |
<< 1019; |
|
1923 |
QTest::newRow("utf32 nobom") |
|
1924 |
<< QByteArray("\0\0\0h\0\0\0e\0\0\0l", 12) |
|
1925 |
<< false |
|
1926 |
<< 0; |
|
1927 |
} |
|
1928 |
||
1929 |
void tst_QTextCodec::codecForUtfText() |
|
1930 |
{ |
|
1931 |
QFETCH(QByteArray, encoded); |
|
1932 |
QFETCH(bool, detected); |
|
1933 |
QFETCH(int, mib); |
|
1934 |
||
1935 |
QTextCodec *codec = QTextCodec::codecForUtfText(encoded, 0); |
|
1936 |
if (detected) |
|
1937 |
QCOMPARE(codec->mibEnum(), mib); |
|
1938 |
else |
|
1939 |
QVERIFY(codec == 0); |
|
1940 |
} |
|
1941 |
||
1942 |
#ifdef Q_OS_UNIX |
|
1943 |
void tst_QTextCodec::toLocal8Bit() |
|
1944 |
{ |
|
1945 |
#ifdef QT_NO_PROCESS |
|
1946 |
QSKIP("This test requires QProcess", SkipAll); |
|
1947 |
#else |
|
1948 |
QProcess process; |
|
1949 |
process.start("echo/echo"); |
|
1950 |
QString string(QChar(0x410)); |
|
1951 |
process.write((const char*)string.utf16(), string.length()*2); |
|
1952 |
||
1953 |
process.closeWriteChannel(); |
|
1954 |
process.waitForFinished(); |
|
1955 |
QCOMPARE(process.exitStatus(), QProcess::NormalExit); |
|
1956 |
QCOMPARE(process.exitCode(), 0); |
|
1957 |
#endif |
|
1958 |
} |
|
1959 |
#endif |
|
1960 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1961 |
static QByteArray loadAndConvert(const QByteArray &codecName) |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1962 |
{ |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1963 |
QTextCodec *c = QTextCodec::codecForName(codecName); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1964 |
if (!c) { |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1965 |
qDebug() << "WARNING " << codecName << " not found? "; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1966 |
return QByteArray(); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1967 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1968 |
QString str = QString::fromLatin1(codecName); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1969 |
QByteArray b = c->fromUnicode(str); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1970 |
c->toUnicode(b); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1971 |
return codecName; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1972 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1973 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1974 |
static int loadAndConvertMIB(int mib) |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1975 |
{ |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1976 |
QTextCodec *c = QTextCodec::codecForMib(mib); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1977 |
if (!c) { |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1978 |
qDebug() << "WARNING " << mib << " not found? "; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1979 |
return 0; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1980 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1981 |
QString str = QString::number(mib); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1982 |
QByteArray b = c->fromUnicode(str); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1983 |
c->toUnicode(b); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1984 |
return mib; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1985 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1986 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1987 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1988 |
void tst_QTextCodec::threadSafety() |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1989 |
{ |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1990 |
QList<QByteArray> codecList = QTextCodec::availableCodecs(); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1991 |
QList<int> mibList = QTextCodec::availableMibs(); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1992 |
#ifndef QT_NO_CONCURRENT |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1993 |
QThreadPool::globalInstance()->setMaxThreadCount(12); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1994 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1995 |
QFuture<QByteArray> res = QtConcurrent::mapped(codecList, loadAndConvert); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1996 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1997 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1998 |
QFuture<int> res2 = QtConcurrent::mapped(mibList, loadAndConvertMIB); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
1999 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2000 |
QCOMPARE(res.results(), codecList); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2001 |
QCOMPARE(res2.results(), mibList); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2002 |
#endif |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2003 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2004 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2005 |
void tst_QTextCodec::invalidNames() |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2006 |
{ |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2007 |
QVERIFY(!QTextCodec::codecForName("")); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2008 |
QVERIFY(!QTextCodec::codecForName(QByteArray())); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2009 |
QVERIFY(!QTextCodec::codecForName("-")); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2010 |
QVERIFY(!QTextCodec::codecForName("\1a\2b\3a\4d\5c\6s\7a\xffr\xec_\x9c_")); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2011 |
QVERIFY(!QTextCodec::codecForName("\n")); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2012 |
QVERIFY(!QTextCodec::codecForName("don't exist")); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2013 |
QByteArray huge = "azertyuiop^$qsdfghjklm<wxcvbn,;:=1234567890°_"; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2014 |
huge = huge + huge + huge + huge + huge + huge + huge + huge; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2015 |
huge = huge + huge + huge + huge + huge + huge + huge + huge; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2016 |
huge = huge + huge + huge + huge + huge + huge + huge + huge; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2017 |
huge = huge + huge + huge + huge + huge + huge + huge + huge; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2018 |
QVERIFY(!QTextCodec::codecForName(huge)); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2019 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2020 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2021 |
void tst_QTextCodec::checkAliases_data() |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2022 |
{ |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2023 |
QTest::addColumn<QByteArray>("codecName"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2024 |
QList<QByteArray> codecList = QTextCodec::availableCodecs(); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2025 |
foreach (const QByteArray &a, codecList) { |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2026 |
QTest::newRow( a.constData() ) << a; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2027 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2028 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2029 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2030 |
void tst_QTextCodec::checkAliases() |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2031 |
{ |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2032 |
QFETCH( QByteArray, codecName ); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2033 |
QTextCodec *c = QTextCodec::codecForName(codecName); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2034 |
QVERIFY(c); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2035 |
QCOMPARE(QTextCodec::codecForName(codecName), c); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2036 |
QCOMPARE(QTextCodec::codecForName(c->name()), c); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2037 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2038 |
foreach(const QByteArray &a, c->aliases()) { |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2039 |
QCOMPARE(QTextCodec::codecForName(a), c); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2040 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2041 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2042 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2043 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2044 |
void tst_QTextCodec::moreToFromUnicode_data() { |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2045 |
QTest::addColumn<QByteArray>("codecName"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2046 |
QTest::addColumn<QByteArray>("testData"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2047 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2048 |
QTest::newRow("russian") << QByteArray("ISO-8859-5") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2049 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF\x00"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2050 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2051 |
QTest::newRow("arabic") << QByteArray("ISO-8859-6") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2052 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA4\xAC\xAD\xBB\xBF\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2053 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2054 |
QTest::newRow("greek") << QByteArray("ISO-8859-7") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2055 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA6\xA7\xA8\xA9\xAB\xAC\xAD\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2056 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2057 |
QTest::newRow("turkish") << QByteArray("ISO-8859-9") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2058 |
<< QByteArray("\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2059 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2060 |
#ifdef Q_OS_SYMBIAN |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2061 |
QTest::newRow("thai") << QByteArray("TIS-620") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2062 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2063 |
#endif |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2064 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2065 |
QTest::newRow("latin1") << QByteArray("ISO-8859-1") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2066 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2067 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2068 |
QByteArray sms7bit_ba; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2069 |
for (int i=1; i <= 0x7f; ++i) { |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2070 |
if (i!='\x1b') { |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2071 |
sms7bit_ba.append(i); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2072 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2073 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2074 |
#ifdef Q_OS_SYMBIAN |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2075 |
QTest::newRow("sms7bit") << QByteArray("SMS 7-bit") << sms7bit_ba; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2076 |
#endif |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2077 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2078 |
QTest::newRow("latin2") << QByteArray("ISO-8859-2") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2079 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2080 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2081 |
QTest::newRow("latin3") << QByteArray("ISO-8859-3") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2082 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBF\xC0\xC1\xC2\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2083 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2084 |
QTest::newRow("latin4") << QByteArray("ISO-8859-4") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2085 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2086 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2087 |
QTest::newRow("russian 2") << QByteArray("ISO-8859-5") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2088 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2089 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2090 |
QTest::newRow("arabic 2") << QByteArray("ISO-8859-6") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2091 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA4\xAC\xAD\xBB\xBF\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2092 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2093 |
QTest::newRow("greek 2") << QByteArray("ISO-8859-7") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2094 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA6\xA7\xA8\xA9\xAB\xAC\xAD\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2095 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2096 |
#ifdef Q_OS_SYMBIAN |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2097 |
QTest::newRow("hebriew") << QByteArray("ISO-8859-8") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2098 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFD\xFE"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2099 |
#endif |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2100 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2101 |
QTest::newRow("latin5") << QByteArray("ISO-8859-9") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2102 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2103 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2104 |
QTest::newRow("latin6") << QByteArray("ISO-8859-10") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2105 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2106 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2107 |
#if 0 |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2108 |
QByteArray iso8859_11_ba; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2109 |
for (int x=0x20; x<=0x7f; ++x) { |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2110 |
iso8859_11_ba.append(x); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2111 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2112 |
for (int x=0xa0; x<0xff; ++x) { |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2113 |
if ((x>=0xdb && x<0xdf) || x>0xfb){ |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2114 |
continue; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2115 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2116 |
iso8859_11_ba.append(x); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2117 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2118 |
QTest::newRow("latin-thai") << QByteArray("ISO-8859-11") << iso8859_11_ba; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2119 |
#endif |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2120 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2121 |
QTest::newRow("latin7") << QByteArray("ISO-8859-13") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2122 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2123 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2124 |
QTest::newRow("celtic") << QByteArray("ISO-8859-14") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2125 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2126 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2127 |
QTest::newRow("latin9") << QByteArray("ISO-8859-15") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2128 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2129 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2130 |
QTest::newRow("latin10") << QByteArray("ISO-8859-16") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2131 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2132 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2133 |
QTest::newRow("cp850") << QByteArray("CP850") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2134 |
<< QByteArray("\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2135 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2136 |
QTest::newRow("cp874") << QByteArray("CP874") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2137 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x85\x91\x92\x93\x94\x95\x96\x97\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2138 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2139 |
QTest::newRow("cp1250") << QByteArray("CP1250") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2140 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x82\x84\x85\x86\x87\x89\x8A\x8B\x8C\x8D\x8E\x8F\x91\x92\x93\x94\x95\x96\x97\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2141 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2142 |
QTest::newRow("cp1251") << QByteArray("CP1251") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2143 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2144 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2145 |
QTest::newRow("cp1252") << QByteArray("CP1252") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2146 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8E\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2147 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2148 |
QTest::newRow("cp1253") << QByteArray("CP1253") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2149 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x82\x83\x84\x85\x86\x87\x89\x8B\x91\x92\x93\x94\x95\x96\x97\x99\x9B\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2150 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2151 |
QTest::newRow("cp1254") << QByteArray("CP1254") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2152 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2153 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2154 |
QTest::newRow("cp1255") << QByteArray("CP1255") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2155 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x82\x83\x84\x85\x86\x87\x88\x89,x8B\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9B\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFD\xFE"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2156 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2157 |
QTest::newRow("cp1256") << QByteArray("CP1256") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2158 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2159 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2160 |
QTest::newRow("cp1257") << QByteArray("CP1257") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2161 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x82\x84\x85\x86\x87\x89\x8B\x8D\x8E\x8F\x91\x92\x93\x94\x95\x96\x97\x99\x9B\x9D\x9E\xA0\xA2\xA3\xA4\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2162 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2163 |
QTest::newRow("cp1258") << QByteArray("CP1258") |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2164 |
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8B\x8C\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9B\x9C\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2165 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2166 |
QByteArray koi8_r_ba; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2167 |
for (int x=0x20; x<=0xff; ++x) { |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2168 |
if (x!=0x9A && x!=0xbf) { |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2169 |
koi8_r_ba.append(x); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2170 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2171 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2172 |
QTest::newRow("KOI8-R") << QByteArray("KOI8-R") << koi8_r_ba; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2173 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2174 |
QByteArray koi8_u_ba; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2175 |
for (int x=0x20; x<=0xff; ++x) { |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2176 |
koi8_u_ba.append(x); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2177 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2178 |
QTest::newRow("KOI8-U") << QByteArray("KOI8-U") << koi8_u_ba; |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2179 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2180 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2181 |
void tst_QTextCodec::moreToFromUnicode() |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2182 |
{ |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2183 |
QFETCH( QByteArray, codecName ); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2184 |
QFETCH( QByteArray, testData ); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2185 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2186 |
QTextCodec *c = QTextCodec::codecForName( codecName.data() ); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2187 |
QVERIFY(c); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2188 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2189 |
QString uStr = c->toUnicode(testData); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2190 |
QByteArray cStr = c->fromUnicode(uStr); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2191 |
QCOMPARE(testData, cStr); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2192 |
} |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2193 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
2194 |
|
0 | 2195 |
QTEST_MAIN(tst_QTextCodec) |
2196 |
#include "tst_qtextcodec.moc" |