cid#1607171 Data race condition
[LibreOffice.git] / sal / qa / rtl / textenc / rtl_textcvt.cxx
blobfe6c8251d88d005632525f957901d46517339144
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <config_locales.h>
22 #include <sal/config.h>
24 #include <cppunit/TestFixture.h>
25 #include <cppunit/extensions/HelperMacros.h>
27 #include <o3tl/cppunittraitshelper.hxx>
28 #include <rtl/string.hxx>
29 #include <rtl/ustring.hxx>
30 #include <rtl/tencinfo.h>
31 #include <rtl/textcvt.h>
32 #include <rtl/textenc.h>
33 #include <sal/types.h>
34 #include <sal/macros.h>
35 #include <osl/diagnose.h>
37 namespace {
39 struct SingleByteCharSet {
40 rtl_TextEncoding m_nEncoding;
41 sal_Unicode m_aMap[256];
44 void testSingleByteCharSet(SingleByteCharSet const & rSet) {
45 char aText[256];
46 sal_Unicode aUnicode[256];
47 sal_Size nNumber = 0;
48 for (int i = 0; i < 256; ++i) {
49 if (rSet.m_aMap[i] != 0xFFFF) {
50 aText[nNumber++] = static_cast< char >(i);
54 rtl_TextToUnicodeConverter aConverter
55 = rtl_createTextToUnicodeConverter(rSet.m_nEncoding);
56 CPPUNIT_ASSERT_MESSAGE(OUStringToOString(Concat2View("rtl_createTextToUnicodeConverter(" + OUString::number(rSet.m_nEncoding) + ") failed"),
57 RTL_TEXTENCODING_UTF8).getStr(),
58 aConverter != nullptr);
59 rtl_TextToUnicodeContext aContext
60 = rtl_createTextToUnicodeContext(aConverter);
61 CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", aContext != nullptr);
62 sal_Size nSize;
63 sal_uInt32 nInfo;
64 sal_Size nConverted;
65 nSize = rtl_convertTextToUnicode(
66 aConverter, aContext, aText, nNumber, aUnicode, nNumber,
67 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
68 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
69 | RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR),
70 &nInfo, &nConverted);
71 CPPUNIT_ASSERT_EQUAL(nNumber, nSize);
72 CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), nInfo);
73 CPPUNIT_ASSERT_EQUAL(nNumber, nConverted);
74 rtl_destroyTextToUnicodeContext(aConverter, aContext);
75 rtl_destroyTextToUnicodeConverter(aConverter);
78 int j = 0;
79 for (int i = 0; i < 256; ++i) {
80 if (rSet.m_aMap[i] != 0xFFFF && aUnicode[j] != rSet.m_aMap[i]) {
81 CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(Concat2View("rSet.m_aMap[" + OUString::number(i) + "] == " +
82 OUString::number(rSet.m_aMap[i], 16)),
83 RTL_TEXTENCODING_UTF8).getStr(),
84 u'\xFFFF', rSet.m_aMap[i]);
85 CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(Concat2View("aUnicode[" + OUString::number(j) + "] == " +
86 OUString::number(aUnicode[j], 16) +
87 ", rSet.m_aMap[" + OUString::number(i) + "] == " +
88 OUString::number(rSet.m_aMap[i], 16)),
89 RTL_TEXTENCODING_UTF8).getStr(),
90 rSet.m_aMap[i], aUnicode[j]);
92 if (rSet.m_aMap[i] != 0xFFFF)
93 j++;
96 if (rSet.m_nEncoding == RTL_TEXTENCODING_ASCII_US) {
97 nNumber = 128;
100 rtl_UnicodeToTextConverter aConverter
101 = rtl_createUnicodeToTextConverter(rSet.m_nEncoding);
102 CPPUNIT_ASSERT_MESSAGE(OUStringToOString(Concat2View("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rSet.m_nEncoding)) + ") failed"),
103 RTL_TEXTENCODING_UTF8).getStr(),
104 aConverter != nullptr);
105 rtl_UnicodeToTextContext aContext
106 = rtl_createUnicodeToTextContext(aConverter);
107 CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", aContext != nullptr);
108 sal_Size nSize;
109 sal_uInt32 nInfo;
110 sal_Size nConverted;
111 nSize = rtl_convertUnicodeToText(
112 aConverter, aContext, aUnicode, nNumber, aText, nNumber,
113 (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
114 | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR),
115 &nInfo, &nConverted);
116 CPPUNIT_ASSERT_EQUAL(nNumber, nSize);
117 CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), nInfo);
118 CPPUNIT_ASSERT_EQUAL(nNumber, nConverted);
119 rtl_destroyUnicodeToTextContext(aConverter, aContext);
120 rtl_destroyUnicodeToTextConverter(aConverter);
123 int j = 0;
124 for (int i = 0; i < 256; ++i) {
125 if (rSet.m_aMap[i] != 0xFFFF
126 && aText[j] != static_cast< char >(i))
128 CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(Concat2View("rSet.m_aMap[" + OUString::number(i) + "] == " +
129 OUString::number(rSet.m_aMap[i], 16)),
130 RTL_TEXTENCODING_UTF8).getStr(),
131 u'\xFFFF', rSet.m_aMap[i]);
132 CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(Concat2View("aText[" + OUString::number(j) + "] == " +
133 OUString::number(i, 16)),
134 RTL_TEXTENCODING_UTF8).getStr(),
135 static_cast< char >(i), aText[j]);
137 if (rSet.m_aMap[i] != 0xFFFF)
138 j++;
141 for (int i = 0; i < 256; ++i) {
142 if (rSet.m_aMap[i] == 0xFFFF) {
143 aText[0] = static_cast< char >(i);
144 rtl_TextToUnicodeConverter aConverter
145 = rtl_createTextToUnicodeConverter(rSet.m_nEncoding);
146 CPPUNIT_ASSERT_MESSAGE(OUStringToOString(Concat2View("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rSet.m_nEncoding)) + ") failed"),
147 RTL_TEXTENCODING_UTF8).getStr(),
148 aConverter != nullptr);
149 rtl_TextToUnicodeContext aContext
150 = rtl_createTextToUnicodeContext(aConverter);
151 CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", aContext != nullptr);
152 sal_Size nSize;
153 sal_uInt32 nInfo;
154 sal_Size nConverted;
155 nSize = rtl_convertTextToUnicode(
156 aConverter, aContext, aText, 1, aUnicode, 1,
157 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
158 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
159 | RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR),
160 &nInfo, &nConverted);
162 sal_uInt32 nExpectedInfo = (RTL_TEXTTOUNICODE_INFO_ERROR | RTL_TEXTTOUNICODE_INFO_UNDEFINED);
164 CPPUNIT_ASSERT_EQUAL(sal_Size(0), nSize);
165 CPPUNIT_ASSERT_EQUAL(nExpectedInfo, nInfo);
166 CPPUNIT_ASSERT_EQUAL(sal_Size(1), nConverted);
168 rtl_destroyTextToUnicodeContext(aConverter, aContext);
169 rtl_destroyTextToUnicodeConverter(aConverter);
174 int const TEST_STRING_SIZE = 1000;
176 struct ComplexCharSetTest {
177 rtl_TextEncoding m_nEncoding;
178 char const * m_pText;
179 sal_Size m_nTextSize;
180 sal_Unicode m_aUnicode[TEST_STRING_SIZE];
181 sal_Size m_nUnicodeSize;
182 bool m_bNoContext;
183 bool m_bForward;
184 bool m_bReverse;
185 bool m_bGlobalSignature;
186 sal_uInt32 m_nReverseUndefined;
189 void doComplexCharSetTest(ComplexCharSetTest const & rTest) {
190 if (rTest.m_bForward) {
191 sal_Unicode aUnicode[TEST_STRING_SIZE];
192 rtl_TextToUnicodeConverter aConverter
193 = rtl_createTextToUnicodeConverter(rTest.m_nEncoding);
194 CPPUNIT_ASSERT_MESSAGE(OUStringToOString(Concat2View("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"),
195 RTL_TEXTENCODING_UTF8).getStr(),
196 aConverter != nullptr);
197 rtl_TextToUnicodeContext aContext
198 = rtl_createTextToUnicodeContext(aConverter);
199 CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", aContext != nullptr);
200 sal_Size nSize;
201 sal_uInt32 nInfo;
202 sal_Size nConverted;
203 nSize = rtl_convertTextToUnicode(
204 aConverter, aContext,
205 reinterpret_cast< char const * >(rTest.m_pText),
206 rTest.m_nTextSize, aUnicode, TEST_STRING_SIZE,
207 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
208 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
209 | RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR
210 | RTL_TEXTTOUNICODE_FLAGS_FLUSH
211 | (rTest.m_bGlobalSignature ?
212 RTL_TEXTTOUNICODE_FLAGS_GLOBAL_SIGNATURE : 0)),
213 &nInfo, &nConverted);
214 CPPUNIT_ASSERT_EQUAL(rTest.m_nUnicodeSize, nSize);
215 CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), nInfo);
216 CPPUNIT_ASSERT_EQUAL(rTest.m_nTextSize, nConverted);
218 rtl_destroyTextToUnicodeContext(aConverter, aContext);
219 rtl_destroyTextToUnicodeConverter(aConverter);
221 for (sal_Size i = 0; i < rTest.m_nUnicodeSize; ++i) {
222 CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(Concat2View("aUnicode[" + OUString::number(i) + "] == " +
223 OUString::number(aUnicode[i], 16) +
224 ", rTest.m_aUnicode[" + OUString::number(i) + "] == " +
225 OUString::number(rTest.m_aUnicode[i], 16)),
226 RTL_TEXTENCODING_UTF8).getStr(),
227 rTest.m_aUnicode[i], aUnicode[i]);
230 if (rTest.m_bForward) {
231 sal_Unicode aUnicode[TEST_STRING_SIZE];
232 rtl_TextToUnicodeConverter aConverter
233 = rtl_createTextToUnicodeConverter(rTest.m_nEncoding);
234 CPPUNIT_ASSERT_MESSAGE(OUStringToOString(Concat2View("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"),
235 RTL_TEXTENCODING_UTF8).getStr(),
236 aConverter != nullptr);
237 rtl_TextToUnicodeContext aContext
238 = rtl_createTextToUnicodeContext(aConverter);
239 CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", aContext != nullptr);
240 if (aContext != reinterpret_cast<rtl_TextToUnicodeContext>(1)) {
241 sal_Size nInput = 0;
242 sal_Size nOutput = 0;
243 for (bool bFlush = true; nInput < rTest.m_nTextSize || bFlush;) {
244 sal_Size nSrcBytes = 1;
245 sal_uInt32 nFlags
246 = (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
247 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
248 | RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR
249 | (rTest.m_bGlobalSignature ?
250 RTL_TEXTTOUNICODE_FLAGS_GLOBAL_SIGNATURE : 0));
251 if (nInput >= rTest.m_nTextSize) {
252 nSrcBytes = 0;
253 nFlags |= RTL_TEXTTOUNICODE_FLAGS_FLUSH;
254 bFlush = false;
256 sal_uInt32 nInfo;
257 sal_Size nConverted;
258 sal_Size nSize = rtl_convertTextToUnicode(
259 aConverter, aContext,
260 rTest.m_pText + nInput,
261 nSrcBytes, aUnicode + nOutput, TEST_STRING_SIZE - nOutput,
262 nFlags, &nInfo, &nConverted);
263 nOutput += nSize;
264 nInput += nConverted;
265 CPPUNIT_ASSERT_EQUAL(sal_uInt32(0),
266 (nInfo & ~RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOOSMALL));
268 CPPUNIT_ASSERT_EQUAL(rTest.m_nUnicodeSize, nOutput);
269 CPPUNIT_ASSERT_EQUAL(rTest.m_nTextSize, nInput);
271 for (sal_Size i = 0; i < rTest.m_nUnicodeSize; ++i) {
272 CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(Concat2View("aUnicode[" + OUString::number(i) + "] == " +
273 OUString::number(aUnicode[i], 16) +
274 ", rTest.m_aUnicode[" + OUString::number(i) + "] == " +
275 OUString::number(rTest.m_aUnicode[i], 16)),
276 RTL_TEXTENCODING_UTF8).getStr(),
277 rTest.m_aUnicode[i], aUnicode[i]);
280 rtl_destroyTextToUnicodeContext(aConverter, aContext);
281 rtl_destroyTextToUnicodeConverter(aConverter);
283 if (rTest.m_bNoContext && rTest.m_bForward) {
284 sal_Unicode aUnicode[TEST_STRING_SIZE] = { 0, };
285 int nSize = 0;
286 rtl_TextToUnicodeConverter aConverter
287 = rtl_createTextToUnicodeConverter(rTest.m_nEncoding);
288 CPPUNIT_ASSERT_MESSAGE(OUStringToOString(Concat2View("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"),
289 RTL_TEXTENCODING_UTF8).getStr(),
290 aConverter != nullptr);
291 for (sal_Size i = 0;;) {
292 if (i == rTest.m_nTextSize) {
293 goto done;
295 char c1 = rTest.m_pText[i++];
296 sal_Unicode aUC[2];
297 sal_uInt32 nInfo = 0;
298 sal_Size nCvtBytes;
299 sal_Size nChars = rtl_convertTextToUnicode(
300 aConverter, nullptr, &c1, 1, aUC, 2,
301 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
302 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
303 | RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR
304 | (rTest.m_bGlobalSignature ?
305 RTL_TEXTTOUNICODE_FLAGS_GLOBAL_SIGNATURE : 0)),
306 &nInfo, &nCvtBytes);
307 if ((nInfo & RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOOSMALL) != 0) {
308 char sBuffer[10];
309 sBuffer[0] = c1;
310 sal_uInt16 nLen = 1;
311 while ((nInfo & RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOOSMALL) != 0
312 && nLen < 10)
314 if (i == rTest.m_nTextSize) {
315 goto done;
317 c1 = rTest.m_pText[i++];
318 sBuffer[nLen++] = c1;
319 nChars = rtl_convertTextToUnicode(
320 aConverter, nullptr, sBuffer, nLen, aUC, 2,
321 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
322 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
323 | RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR
324 | (rTest.m_bGlobalSignature ?
325 RTL_TEXTTOUNICODE_FLAGS_GLOBAL_SIGNATURE : 0)),
326 &nInfo, &nCvtBytes);
328 if (nChars == 1 && nInfo == 0) {
329 OSL_ASSERT(nCvtBytes == nLen);
330 aUnicode[nSize++] = aUC[0];
331 } else if (nChars == 2 && nInfo == 0) {
332 OSL_ASSERT(nCvtBytes == nLen);
333 aUnicode[nSize++] = aUC[0];
334 aUnicode[nSize++] = aUC[1];
335 } else {
336 OSL_ASSERT(
337 (nInfo & RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOOSMALL) == 0
338 && nChars == 0 && nInfo != 0);
339 aUnicode[nSize++] = sBuffer[0];
340 i -= nLen - 1;
342 } else if (nChars == 1 && nInfo == 0) {
343 OSL_ASSERT(nCvtBytes == 1);
344 aUnicode[nSize++] = aUC[0];
345 } else if (nChars == 2 && nInfo == 0) {
346 OSL_ASSERT(nCvtBytes == 1);
347 aUnicode[nSize++] = aUC[0];
348 aUnicode[nSize++] = aUC[1];
349 } else {
350 OSL_ASSERT(nChars == 0 && nInfo != 0);
351 aUnicode[nSize++] = c1;
354 done:
355 rtl_destroyTextToUnicodeConverter(aConverter);
356 for (sal_Size i = 0; i < rTest.m_nUnicodeSize; ++i) {
357 CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(Concat2View("aUnicode[" + OUString::number(i) + "] == " +
358 OUString::number(aUnicode[i], 16) +
359 ", rTest.m_aUnicode[" + OUString::number(i) + "] == " +
360 OUString::number(rTest.m_aUnicode[i], 16)),
361 RTL_TEXTENCODING_UTF8).getStr(),
362 rTest.m_aUnicode[i], aUnicode[i]);
365 if (rTest.m_bReverse) {
366 char aText[TEST_STRING_SIZE];
367 rtl_UnicodeToTextConverter aConverter
368 = rtl_createUnicodeToTextConverter(rTest.m_nEncoding);
369 CPPUNIT_ASSERT_MESSAGE(OUStringToOString(Concat2View("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"),
370 RTL_TEXTENCODING_UTF8).getStr(),
371 aConverter != nullptr);
372 rtl_UnicodeToTextContext aContext
373 = rtl_createUnicodeToTextContext(aConverter);
374 CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", aContext != nullptr);
375 sal_Size nSize;
376 sal_uInt32 nInfo;
377 sal_Size nConverted;
378 nSize = rtl_convertUnicodeToText(
379 aConverter, aContext, rTest.m_aUnicode, rTest.m_nUnicodeSize, aText,
380 TEST_STRING_SIZE,
381 (rTest.m_nReverseUndefined | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR
382 | RTL_UNICODETOTEXT_FLAGS_FLUSH
383 | (rTest.m_bGlobalSignature ?
384 RTL_UNICODETOTEXT_FLAGS_GLOBAL_SIGNATURE : 0)),
385 &nInfo, &nConverted);
386 CPPUNIT_ASSERT_EQUAL(rTest.m_nTextSize, nSize);
387 if (nInfo != 0)
389 CPPUNIT_ASSERT_EQUAL(RTL_UNICODETOTEXT_INFO_UNDEFINED, nInfo);
390 CPPUNIT_ASSERT_MESSAGE("rTest.m_nReverseUndefined should not be RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR",
391 rTest.m_nReverseUndefined != RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR);
393 CPPUNIT_ASSERT_EQUAL(rTest.m_nUnicodeSize, nConverted);
394 rtl_destroyUnicodeToTextContext(aConverter, aContext);
395 rtl_destroyUnicodeToTextConverter(aConverter);
396 for (sal_Size i = 0; i < rTest.m_nTextSize; ++i) {
397 CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(Concat2View("aText[" + OUString::number(i) + "] == " +
398 OUString::number(aText[i], 16) +
399 ", rTest.m_pText[" + OUString::number(i) + "] == " +
400 OUString::number(rTest.m_pText[i], 16)),
401 RTL_TEXTENCODING_UTF8).getStr(),
402 rTest.m_pText[i], aText[i]);
407 void doComplexCharSetCutTest(ComplexCharSetTest const & rTest) {
408 if (rTest.m_bNoContext) {
409 sal_Unicode aUnicode[TEST_STRING_SIZE];
410 rtl_TextToUnicodeConverter aConverter
411 = rtl_createTextToUnicodeConverter(rTest.m_nEncoding);
412 CPPUNIT_ASSERT_MESSAGE(OUStringToOString(Concat2View("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"),
413 RTL_TEXTENCODING_UTF8).getStr(),
414 aConverter != nullptr);
415 sal_Size nSize;
416 sal_uInt32 nInfo;
417 sal_Size nConverted;
418 nSize = rtl_convertTextToUnicode(
419 aConverter, nullptr, reinterpret_cast< char const * >(rTest.m_pText),
420 rTest.m_nTextSize, aUnicode, TEST_STRING_SIZE,
421 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
422 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
423 | RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR),
424 &nInfo, &nConverted);
426 CPPUNIT_ASSERT_EQUAL(rTest.m_nUnicodeSize, nSize);
427 if (nInfo != RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOOSMALL)
429 CPPUNIT_ASSERT_EQUAL(RTL_TEXTTOUNICODE_INFO_ERROR | RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOOSMALL,
430 nInfo);
432 CPPUNIT_ASSERT_MESSAGE("nConverted should be less than rTest.m_nTextSize", nConverted < rTest.m_nTextSize);
434 rtl_destroyTextToUnicodeConverter(aConverter);
435 for (sal_Size i = 0; i < nSize; ++i) {
436 CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(Concat2View("aUnicode[" + OUString::number(i) + "] == " +
437 OUString::number(aUnicode[i], 16) +
438 ", rTest.m_aUnicode[" + OUString::number(i) + "] == " +
439 OUString::number(rTest.m_aUnicode[i], 16)),
440 RTL_TEXTENCODING_UTF8).getStr(),
441 rTest.m_aUnicode[i], aUnicode[i]);
446 class Test: public CppUnit::TestFixture {
447 public:
448 void testSingleByte();
450 void testComplex();
452 void testComplexCut();
454 void testInvalidUtf7();
456 void testInvalidUtf8();
458 void testInvalidUnicode();
460 void testSRCBUFFERTOSMALL();
462 void testMime();
464 void testWindows();
466 void testInfo();
468 CPPUNIT_TEST_SUITE(Test);
469 CPPUNIT_TEST(testSingleByte);
470 CPPUNIT_TEST(testComplex);
471 CPPUNIT_TEST(testComplexCut);
472 CPPUNIT_TEST(testInvalidUtf7);
473 CPPUNIT_TEST(testInvalidUtf8);
474 CPPUNIT_TEST(testInvalidUnicode);
475 CPPUNIT_TEST(testSRCBUFFERTOSMALL);
476 CPPUNIT_TEST(testMime);
477 CPPUNIT_TEST(testWindows);
478 CPPUNIT_TEST(testInfo);
479 CPPUNIT_TEST_SUITE_END();
482 void Test::testSingleByte() {
483 static SingleByteCharSet const data[]
484 = { { RTL_TEXTENCODING_MS_1250,
485 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
486 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
487 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
488 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
489 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
490 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
491 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
492 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
493 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
494 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
495 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
496 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
497 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
498 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
499 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
500 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
501 0x20AC,0xFFFF,0x201A,0xFFFF,0x201E,0x2026,0x2020,0x2021,
502 0xFFFF,0x2030,0x0160,0x2039,0x015A,0x0164,0x017D,0x0179,
503 0xFFFF,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
504 0xFFFF,0x2122,0x0161,0x203A,0x015B,0x0165,0x017E,0x017A,
505 0x00A0,0x02C7,0x02D8,0x0141,0x00A4,0x0104,0x00A6,0x00A7,
506 0x00A8,0x00A9,0x015E,0x00AB,0x00AC,0x00AD,0x00AE,0x017B,
507 0x00B0,0x00B1,0x02DB,0x0142,0x00B4,0x00B5,0x00B6,0x00B7,
508 0x00B8,0x0105,0x015F,0x00BB,0x013D,0x02DD,0x013E,0x017C,
509 0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7,
510 0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E,
511 0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7,
512 0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF,
513 0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7,
514 0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F,
515 0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7,
516 0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 } },
517 { RTL_TEXTENCODING_MS_1251,
518 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
519 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
520 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
521 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
522 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
523 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
524 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
525 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
526 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
527 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
528 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
529 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
530 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
531 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
532 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
533 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
534 0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021,
535 0x20AC,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F,
536 0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
537 0xFFFF,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F,
538 0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7,
539 0x0401,0x00A9,0x0404,0x00AB,0x00AC,0x00AD,0x00AE,0x0407,
540 0x00B0,0x00B1,0x0406,0x0456,0x0491,0x00B5,0x00B6,0x00B7,
541 0x0451,0x2116,0x0454,0x00BB,0x0458,0x0405,0x0455,0x0457,
542 0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417,
543 0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F,
544 0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427,
545 0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F,
546 0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437,
547 0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F,
548 0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447,
549 0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F } },
550 { RTL_TEXTENCODING_MS_1252,
551 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
552 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
553 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
554 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
555 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
556 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
557 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
558 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
559 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
560 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
561 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
562 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
563 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
564 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
565 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
566 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
567 0x20AC,0xFFFF,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021,
568 0x02C6,0x2030,0x0160,0x2039,0x0152,0xFFFF,0x017D,0xFFFF,
569 0xFFFF,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
570 0x02DC,0x2122,0x0161,0x203A,0x0153,0xFFFF,0x017E,0x0178,
571 0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
572 0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
573 0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
574 0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
575 0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,
576 0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,
577 0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7,
578 0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF,
579 0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,
580 0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,
581 0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7,
582 0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF } },
583 { RTL_TEXTENCODING_MS_1253,
584 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
585 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
586 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
587 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
588 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
589 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
590 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
591 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
592 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
593 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
594 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
595 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
596 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
597 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
598 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
599 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
600 0x20AC,0xFFFF,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021,
601 0xFFFF,0x2030,0xFFFF,0x2039,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
602 0xFFFF,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
603 0xFFFF,0x2122,0xFFFF,0x203A,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
604 0x00A0,0x0385,0x0386,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
605 0x00A8,0x00A9,0xFFFF,0x00AB,0x00AC,0x00AD,0x00AE,0x2015,
606 0x00B0,0x00B1,0x00B2,0x00B3,0x0384,0x00B5,0x00B6,0x00B7,
607 0x0388,0x0389,0x038A,0x00BB,0x038C,0x00BD,0x038E,0x038F,
608 0x0390,0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397,
609 0x0398,0x0399,0x039A,0x039B,0x039C,0x039D,0x039E,0x039F,
610 0x03A0,0x03A1,0xFFFF,0x03A3,0x03A4,0x03A5,0x03A6,0x03A7,
611 0x03A8,0x03A9,0x03AA,0x03AB,0x03AC,0x03AD,0x03AE,0x03AF,
612 0x03B0,0x03B1,0x03B2,0x03B3,0x03B4,0x03B5,0x03B6,0x03B7,
613 0x03B8,0x03B9,0x03BA,0x03BB,0x03BC,0x03BD,0x03BE,0x03BF,
614 0x03C0,0x03C1,0x03C2,0x03C3,0x03C4,0x03C5,0x03C6,0x03C7,
615 0x03C8,0x03C9,0x03CA,0x03CB,0x03CC,0x03CD,0x03CE,0xFFFF } },
616 { RTL_TEXTENCODING_MS_1254,
617 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
618 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
619 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
620 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
621 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
622 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
623 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
624 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
625 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
626 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
627 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
628 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
629 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
630 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
631 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
632 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
633 0x20AC,0xFFFF,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021,
634 0x02C6,0x2030,0x0160,0x2039,0x0152,0xFFFF,0xFFFF,0xFFFF,
635 0xFFFF,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
636 0x02DC,0x2122,0x0161,0x203A,0x0153,0xFFFF,0xFFFF,0x0178,
637 0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
638 0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
639 0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
640 0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
641 0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,
642 0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,
643 0x011E,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7,
644 0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x0130,0x015E,0x00DF,
645 0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,
646 0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,
647 0x011F,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7,
648 0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x0131,0x015F,0x00FF } },
649 { RTL_TEXTENCODING_APPLE_ROMAN,
650 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
651 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
652 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
653 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
654 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
655 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
656 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
657 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
658 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
659 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
660 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
661 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
662 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
663 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
664 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
665 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E, 0x7F,
666 0x00C4,0x00C5,0x00C7,0x00C9,0x00D1,0x00D6,0x00DC,0x00E1,
667 0x00E0,0x00E2,0x00E4,0x00E3,0x00E5,0x00E7,0x00E9,0x00E8,
668 0x00EA,0x00EB,0x00ED,0x00EC,0x00EE,0x00EF,0x00F1,0x00F3,
669 0x00F2,0x00F4,0x00F6,0x00F5,0x00FA,0x00F9,0x00FB,0x00FC,
670 0x2020,0x00B0,0x00A2,0x00A3,0x00A7,0x2022,0x00B6,0x00DF,
671 0x00AE,0x00A9,0x2122,0x00B4,0x00A8,0x2260,0x00C6,0x00D8,
672 0x221E,0x00B1,0x2264,0x2265,0x00A5,0x00B5,0x2202,0x2211,
673 0x220F,0x03C0,0x222B,0x00AA,0x00BA,0x03A9,0x00E6,0x00F8,
674 0x00BF,0x00A1,0x00AC,0x221A,0x0192,0x2248,0x2206,0x00AB,
675 0x00BB,0x2026,0x00A0,0x00C0,0x00C3,0x00D5,0x0152,0x0153,
676 0x2013,0x2014,0x201C,0x201D,0x2018,0x2019,0x00F7,0x25CA,
677 0x00FF,0x0178,0x2044,0x20AC,0x2039,0x203A,0xFB01,0xFB02,
678 0x2021,0x00B7,0x201A,0x201E,0x2030,0x00C2,0x00CA,0x00C1,
679 0x00CB,0x00C8,0x00CD,0x00CE,0x00CF,0x00CC,0x00D3,0x00D4,
680 0xF8FF,0x00D2,0x00DA,0x00DB,0x00D9,0x0131,0x02C6,0x02DC,
681 0x00AF,0x02D8,0x02D9,0x02DA,0x00B8,0x02DD,0x02DB,0x02C7 } },
682 { RTL_TEXTENCODING_IBM_437,
683 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
684 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
685 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
686 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
687 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
688 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
689 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
690 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
691 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
692 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
693 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
694 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
695 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
696 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
697 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
698 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
699 0x00c7,0x00fc,0x00e9,0x00e2,0x00e4,0x00e0,0x00e5,0x00e7,
700 0x00ea,0x00eb,0x00e8,0x00ef,0x00ee,0x00ec,0x00c4,0x00c5,
701 0x00c9,0x00e6,0x00c6,0x00f4,0x00f6,0x00f2,0x00fb,0x00f9,
702 0x00ff,0x00d6,0x00dc,0x00a2,0x00a3,0x00a5,0x20a7,0x0192,
703 0x00e1,0x00ed,0x00f3,0x00fa,0x00f1,0x00d1,0x00aa,0x00ba,
704 0x00bf,0x2310,0x00ac,0x00bd,0x00bc,0x00a1,0x00ab,0x00bb,
705 0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556,
706 0x2555,0x2563,0x2551,0x2557,0x255d,0x255c,0x255b,0x2510,
707 0x2514,0x2534,0x252c,0x251c,0x2500,0x253c,0x255e,0x255f,
708 0x255a,0x2554,0x2569,0x2566,0x2560,0x2550,0x256c,0x2567,
709 0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256b,
710 0x256a,0x2518,0x250c,0x2588,0x2584,0x258c,0x2590,0x2580,
711 0x03b1,0x00df,0x0393,0x03c0,0x03a3,0x03c3,0x00b5,0x03c4,
712 0x03a6,0x0398,0x03a9,0x03b4,0x221e,0x03c6,0x03b5,0x2229,
713 0x2261,0x00b1,0x2265,0x2264,0x2320,0x2321,0x00f7,0x2248,
714 0x00b0,0x2219,0x00b7,0x221a,0x207f,0x00b2,0x25a0,0x00a0 } },
716 { RTL_TEXTENCODING_ASCII_US,
717 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
718 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
719 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
720 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
721 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
722 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
723 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
724 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
725 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
726 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
727 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
728 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
729 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
730 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
731 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
732 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
733 0x20AC,0xFFFF,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021, // !
734 0x02C6,0x2030,0x0160,0x2039,0x0152,0xFFFF,0x017D,0xFFFF, // !
735 0xFFFF,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, // !
736 0x02DC,0x2122,0x0161,0x203A,0x0153,0xFFFF,0x017E,0x0178, // !
737 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7,
738 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF,
739 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7,
740 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF,
741 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
742 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
743 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,
744 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
745 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
746 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
747 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
748 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF } },
749 { RTL_TEXTENCODING_ISO_8859_1,
750 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
751 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
752 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
753 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
754 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
755 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
756 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
757 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
758 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
759 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
760 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
761 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
762 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
763 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
764 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
765 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
766 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
767 0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
768 0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
769 0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
770 0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
771 0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
772 0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
773 0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
774 0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,
775 0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,
776 0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7,
777 0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF,
778 0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,
779 0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,
780 0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7,
781 0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF } },
782 { RTL_TEXTENCODING_ISO_8859_2,
783 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
784 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
785 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
786 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
787 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
788 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
789 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
790 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
791 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
792 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
793 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
794 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
795 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
796 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
797 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
798 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
799 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
800 0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
801 0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
802 0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
803 0x00A0,0x0104,0x02D8,0x0141,0x00A4,0x013D,0x015A,0x00A7,
804 0x00A8,0x0160,0x015E,0x0164,0x0179,0x00AD,0x017D,0x017B,
805 0x00B0,0x0105,0x02DB,0x0142,0x00B4,0x013E,0x015B,0x02C7,
806 0x00B8,0x0161,0x015F,0x0165,0x017A,0x02DD,0x017E,0x017C,
807 0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7,
808 0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E,
809 0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7,
810 0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF,
811 0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7,
812 0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F,
813 0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7,
814 0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 } },
815 { RTL_TEXTENCODING_ISO_8859_3,
816 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
817 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
818 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
819 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
820 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
821 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
822 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
823 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
824 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
825 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
826 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
827 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
828 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
829 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
830 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
831 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
832 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
833 0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
834 0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
835 0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
836 0x00A0,0x0126,0x02D8,0x00A3,0x00A4,0xFFFF,0x0124,0x00A7,
837 0x00A8,0x0130,0x015E,0x011E,0x0134,0x00AD,0xFFFF,0x017B,
838 0x00B0,0x0127,0x00B2,0x00B3,0x00B4,0x00B5,0x0125,0x00B7,
839 0x00B8,0x0131,0x015F,0x011F,0x0135,0x00BD,0xFFFF,0x017C,
840 0x00C0,0x00C1,0x00C2,0xFFFF,0x00C4,0x010A,0x0108,0x00C7,
841 0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,
842 0xFFFF,0x00D1,0x00D2,0x00D3,0x00D4,0x0120,0x00D6,0x00D7,
843 0x011C,0x00D9,0x00DA,0x00DB,0x00DC,0x016C,0x015C,0x00DF,
844 0x00E0,0x00E1,0x00E2,0xFFFF,0x00E4,0x010B,0x0109,0x00E7,
845 0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,
846 0xFFFF,0x00F1,0x00F2,0x00F3,0x00F4,0x0121,0x00F6,0x00F7,
847 0x011D,0x00F9,0x00FA,0x00FB,0x00FC,0x016D,0x015D,0x02D9 } },
849 { RTL_TEXTENCODING_ISO_8859_6,
850 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
851 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
852 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
853 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
854 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
855 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
856 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
857 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
858 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
859 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
860 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
861 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
862 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
863 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
864 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
865 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
866 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
867 0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
868 0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
869 0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
870 0x00A0,0xFFFF,0xFFFF,0xFFFF,0x00A4,0xFFFF,0xFFFF,0xFFFF,
871 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x060C,0x00AD,0xFFFF,0xFFFF,
872 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
873 0xFFFF,0xFFFF,0xFFFF,0x061B,0xFFFF,0xFFFF,0xFFFF,0x061F,
874 0xFFFF,0x0621,0x0622,0x0623,0x0624,0x0625,0x0626,0x0627,
875 0x0628,0x0629,0x062A,0x062B,0x062C,0x062D,0x062E,0x062F,
876 0x0630,0x0631,0x0632,0x0633,0x0634,0x0635,0x0636,0x0637,
877 0x0638,0x0639,0x063A,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
878 0x0640,0x0641,0x0642,0x0643,0x0644,0x0645,0x0646,0x0647,
879 0x0648,0x0649,0x064A,0x064B,0x064C,0x064D,0x064E,0x064F,
880 0x0650,0x0651,0x0652,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
881 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF } },
883 { RTL_TEXTENCODING_ISO_8859_8,
884 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
885 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
886 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
887 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
888 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
889 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
890 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
891 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
892 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
893 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
894 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
895 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
896 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
897 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
898 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
899 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
900 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
901 0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
902 0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
903 0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
904 0x00A0,0xFFFF,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
905 0x00A8,0x00A9,0x00D7,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
906 0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
907 0x00B8,0x00B9,0x00F7,0x00BB,0x00BC,0x00BD,0x00BE,0xFFFF,
908 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
909 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
910 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
911 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x2017,
912 0x05D0,0x05D1,0x05D2,0x05D3,0x05D4,0x05D5,0x05D6,0x05D7,
913 0x05D8,0x05D9,0x05DA,0x05DB,0x05DC,0x05DD,0x05DE,0x05DF,
914 0x05E0,0x05E1,0x05E2,0x05E3,0x05E4,0x05E5,0x05E6,0x05E7,
915 0x05E8,0x05E9,0x05EA,0xFFFF,0xFFFF,0x200E,0x200F,0xFFFF } },
917 { RTL_TEXTENCODING_TIS_620,
918 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
919 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
920 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
921 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
922 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
923 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
924 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
925 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
926 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
927 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
928 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
929 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
930 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
931 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
932 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
933 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
934 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
935 0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
936 0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
937 0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
938 0x00A0,0x0E01,0x0E02,0x0E03,0x0E04,0x0E05,0x0E06,0x0E07, // !
939 0x0E08,0x0E09,0x0E0A,0x0E0B,0x0E0C,0x0E0D,0x0E0E,0x0E0F,
940 0x0E10,0x0E11,0x0E12,0x0E13,0x0E14,0x0E15,0x0E16,0x0E17,
941 0x0E18,0x0E19,0x0E1A,0x0E1B,0x0E1C,0x0E1D,0x0E1E,0x0E1F,
942 0x0E20,0x0E21,0x0E22,0x0E23,0x0E24,0x0E25,0x0E26,0x0E27,
943 0x0E28,0x0E29,0x0E2A,0x0E2B,0x0E2C,0x0E2D,0x0E2E,0x0E2F,
944 0x0E30,0x0E31,0x0E32,0x0E33,0x0E34,0x0E35,0x0E36,0x0E37,
945 0x0E38,0x0E39,0x0E3A,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x0E3F,
946 0x0E40,0x0E41,0x0E42,0x0E43,0x0E44,0x0E45,0x0E46,0x0E47,
947 0x0E48,0x0E49,0x0E4A,0x0E4B,0x0E4C,0x0E4D,0x0E4E,0x0E4F,
948 0x0E50,0x0E51,0x0E52,0x0E53,0x0E54,0x0E55,0x0E56,0x0E57,
949 0x0E58,0x0E59,0x0E5A,0x0E5B,0xFFFF,0xFFFF,0xFFFF,0xFFFF } },
950 { RTL_TEXTENCODING_MS_874,
951 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
952 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
953 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
954 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
955 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
956 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
957 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
958 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
959 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
960 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
961 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
962 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
963 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
964 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
965 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
966 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
967 0x20AC,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x2026,0xFFFF,0xFFFF,
968 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
969 0xFFFF,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
970 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
971 0x00A0,0x0E01,0x0E02,0x0E03,0x0E04,0x0E05,0x0E06,0x0E07,
972 0x0E08,0x0E09,0x0E0A,0x0E0B,0x0E0C,0x0E0D,0x0E0E,0x0E0F,
973 0x0E10,0x0E11,0x0E12,0x0E13,0x0E14,0x0E15,0x0E16,0x0E17,
974 0x0E18,0x0E19,0x0E1A,0x0E1B,0x0E1C,0x0E1D,0x0E1E,0x0E1F,
975 0x0E20,0x0E21,0x0E22,0x0E23,0x0E24,0x0E25,0x0E26,0x0E27,
976 0x0E28,0x0E29,0x0E2A,0x0E2B,0x0E2C,0x0E2D,0x0E2E,0x0E2F,
977 0x0E30,0x0E31,0x0E32,0x0E33,0x0E34,0x0E35,0x0E36,0x0E37,
978 0x0E38,0x0E39,0x0E3A,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x0E3F,
979 0x0E40,0x0E41,0x0E42,0x0E43,0x0E44,0x0E45,0x0E46,0x0E47,
980 0x0E48,0x0E49,0x0E4A,0x0E4B,0x0E4C,0x0E4D,0x0E4E,0x0E4F,
981 0x0E50,0x0E51,0x0E52,0x0E53,0x0E54,0x0E55,0x0E56,0x0E57,
982 0x0E58,0x0E59,0x0E5A,0x0E5B,0xFFFF,0xFFFF,0xFFFF,0xFFFF } },
983 { RTL_TEXTENCODING_MS_1255,
984 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
985 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
986 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
987 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
988 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
989 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
990 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
991 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
992 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
993 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
994 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
995 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
996 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
997 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
998 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
999 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
1000 0x20AC,0xFFFF,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021,
1001 0x02C6,0x2030,0xFFFF,0x2039,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1002 0xFFFF,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
1003 0x02DC,0x2122,0xFFFF,0x203A,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1004 0x00A0,0x00A1,0x00A2,0x00A3,0x20AA,0x00A5,0x00A6,0x00A7,
1005 0x00A8,0x00A9,0x00D7,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
1006 0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
1007 0x00B8,0x00B9,0x00F7,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
1008 0x05B0,0x05B1,0x05B2,0x05B3,0x05B4,0x05B5,0x05B6,0x05B7,
1009 0x05B8,0x05B9,0xFFFF,0x05BB,0x05BC,0x05BD,0x05BE,0x05BF,
1010 0x05C0,0x05C1,0x05C2,0x05C3,0x05F0,0x05F1,0x05F2,0x05F3,
1011 0x05F4,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1012 0x05D0,0x05D1,0x05D2,0x05D3,0x05D4,0x05D5,0x05D6,0x05D7,
1013 0x05D8,0x05D9,0x05DA,0x05DB,0x05DC,0x05DD,0x05DE,0x05DF,
1014 0x05E0,0x05E1,0x05E2,0x05E3,0x05E4,0x05E5,0x05E6,0x05E7,
1015 0x05E8,0x05E9,0x05EA,0xFFFF,0xFFFF,0x200E,0x200F,0xFFFF } },
1016 { RTL_TEXTENCODING_MS_1256,
1017 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
1018 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
1019 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
1020 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
1021 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
1022 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
1023 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
1024 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
1025 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
1026 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
1027 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
1028 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
1029 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
1030 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
1031 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
1032 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
1033 0x20AC,0x067E,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021,
1034 0x02C6,0x2030,0x0679,0x2039,0x0152,0x0686,0x0698,0x0688,
1035 0x06AF,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
1036 0x06A9,0x2122,0x0691,0x203A,0x0153,0x200C,0x200D,0x06BA,
1037 0x00A0,0x060C,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
1038 0x00A8,0x00A9,0x06BE,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
1039 0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
1040 0x00B8,0x00B9,0x061B,0x00BB,0x00BC,0x00BD,0x00BE,0x061F,
1041 0x06C1,0x0621,0x0622,0x0623,0x0624,0x0625,0x0626,0x0627,
1042 0x0628,0x0629,0x062A,0x062B,0x062C,0x062D,0x062E,0x062F,
1043 0x0630,0x0631,0x0632,0x0633,0x0634,0x0635,0x0636,0x00D7,
1044 0x0637,0x0638,0x0639,0x063A,0x0640,0x0641,0x0642,0x0643,
1045 0x00E0,0x0644,0x00E2,0x0645,0x0646,0x0647,0x0648,0x00E7,
1046 0x00E8,0x00E9,0x00EA,0x00EB,0x0649,0x064A,0x00EE,0x00EF,
1047 0x064B,0x064C,0x064D,0x064E,0x00F4,0x064F,0x0650,0x00F7,
1048 0x0651,0x00F9,0x0652,0x00FB,0x00FC,0x200E,0x200F,0x06D2 } },
1049 { RTL_TEXTENCODING_MS_1257,
1050 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
1051 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
1052 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
1053 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
1054 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
1055 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
1056 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
1057 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
1058 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
1059 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
1060 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
1061 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
1062 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
1063 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
1064 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
1065 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
1066 0x20AC,0xFFFF,0x201A,0xFFFF,0x201E,0x2026,0x2020,0x2021,
1067 0xFFFF,0x2030,0xFFFF,0x2039,0xFFFF,0x00A8,0x02C7,0x00B8,
1068 0xFFFF,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
1069 0xFFFF,0x2122,0xFFFF,0x203A,0xFFFF,0x00AF,0x02DB,0xFFFF,
1070 0x00A0,0xFFFF,0x00A2,0x00A3,0x00A4,0xFFFF,0x00A6,0x00A7,
1071 0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6,
1072 0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
1073 0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6,
1074 0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112,
1075 0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B,
1076 0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7,
1077 0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF,
1078 0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113,
1079 0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C,
1080 0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7,
1081 0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x02D9 } },
1082 { RTL_TEXTENCODING_MS_1258,
1083 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
1084 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
1085 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
1086 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
1087 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
1088 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
1089 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
1090 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
1091 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
1092 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
1093 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
1094 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
1095 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
1096 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
1097 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
1098 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
1099 0x20AC,0xFFFF,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021,
1100 0x02C6,0x2030,0xFFFF,0x2039,0x0152,0xFFFF,0xFFFF,0xFFFF,
1101 0xFFFF,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
1102 0x02DC,0x2122,0xFFFF,0x203A,0x0153,0xFFFF,0xFFFF,0x0178,
1103 0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
1104 0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
1105 0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
1106 0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
1107 0x00C0,0x00C1,0x00C2,0x0102,0x00C4,0x00C5,0x00C6,0x00C7,
1108 0x00C8,0x00C9,0x00CA,0x00CB,0x0300,0x00CD,0x00CE,0x00CF,
1109 0x0110,0x00D1,0x0309,0x00D3,0x00D4,0x01A0,0x00D6,0x00D7,
1110 0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x01AF,0x0303,0x00DF,
1111 0x00E0,0x00E1,0x00E2,0x0103,0x00E4,0x00E5,0x00E6,0x00E7,
1112 0x00E8,0x00E9,0x00EA,0x00EB,0x0301,0x00ED,0x00EE,0x00EF,
1113 0x0111,0x00F1,0x0323,0x00F3,0x00F4,0x01A1,0x00F6,0x00F7,
1114 0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x01B0,0x20AB,0x00FF } },
1115 { RTL_TEXTENCODING_KOI8_U, // RFC 2319
1116 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
1117 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
1118 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
1119 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
1120 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
1121 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
1122 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
1123 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
1124 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
1125 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
1126 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
1127 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
1128 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
1129 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
1130 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
1131 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
1132 0x2500,0x2502,0x250C,0x2510,0x2514,0x2518,0x251C,0x2524,
1133 0x252C,0x2534,0x253C,0x2580,0x2584,0x2588,0x258C,0x2590,
1134 0x2591,0x2592,0x2593,0x2320,0x25A0,0x2219,0x221A,0x2248,
1135 0x2264,0x2265,0x00A0,0x2321,0x00B0,0x00B2,0x00B7,0x00F7,
1136 0x2550,0x2551,0x2552,0x0451,0x0454,0x2554,0x0456,0x0457,
1137 0x2557,0x2558,0x2559,0x255A,0x255B,0x0491,0x255D,0x255E,
1138 0x255F,0x2560,0x2561,0x0401,0x0404,0x2563,0x0406,0x0407,
1139 0x2566,0x2567,0x2568,0x2569,0x256A,0x0490,0x256C,0x00A9,
1140 0x044E,0x0430,0x0431,0x0446,0x0434,0x0435,0x0444,0x0433,
1141 0x0445,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,
1142 0x043F,0x044F,0x0440,0x0441,0x0442,0x0443,0x0436,0x0432,
1143 0x044C,0x044B,0x0437,0x0448,0x044D,0x0449,0x0447,0x044A,
1144 0x042E,0x0410,0x0411,0x0426,0x0414,0x0415,0x0424,0x0413,
1145 0x0425,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,
1146 0x041F,0x042F,0x0420,0x0421,0x0422,0x0423,0x0416,0x0412,
1147 0x042C,0x042B,0x0417,0x0428,0x042D,0x0429,0x0427,0x042A } },
1148 { RTL_TEXTENCODING_ADOBE_STANDARD,
1149 { 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1150 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1151 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1152 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1153 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x2019,
1154 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
1155 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
1156 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
1157 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
1158 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
1159 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
1160 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
1161 0x2018,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
1162 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
1163 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
1164 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0xFFFF,
1165 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1166 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1167 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1168 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1169 0xFFFF,0x00A1,0x00A2,0x00A3,0x2215,0x00A5,0x0192,0x00A7,
1170 0x00A4,0x0027,0x201C,0x00AB,0x2039,0x203A,0xFB01,0xFB02,
1171 0xFFFF,0x2013,0x2020,0x2021,0x00B7,0xFFFF,0x00B6,0x2022,
1172 0x201A,0x201E,0x201D,0x00BB,0x2026,0x2030,0xFFFF,0x00BF,
1173 0xFFFF,0x0060,0x00B4,0x02C6,0x02DC,0x00AF,0x02D8,0x02D9,
1174 0x00A8,0xFFFF,0x02DA,0x00B8,0xFFFF,0x02DD,0x02DB,0x02C7,
1175 0x2014,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1176 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1177 0xFFFF,0x00C6,0xFFFF,0x00AA,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1178 0x0141,0x00D8,0x0152,0x00BA,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1179 0xFFFF,0x00E6,0xFFFF,0xFFFF,0xFFFF,0x0131,0xFFFF,0xFFFF,
1180 0x0142,0x00F8,0x0153,0x00DF,0xFFFF,0xFFFF,0xFFFF,0xFFFF } },
1181 { RTL_TEXTENCODING_ADOBE_SYMBOL,
1182 { 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1183 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1184 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1185 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1186 0x0020,0x0021,0x2200,0x0023,0x2203,0x0025,0x0026,0x220B,
1187 0x0028,0x0029,0x2217,0x002B,0x002C,0x2212,0x002E,0x002F,
1188 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
1189 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
1190 0x2245,0x0391,0x0392,0x03A7,0x0394,0x0395,0x03A6,0x0393,
1191 0x0397,0x0399,0x03D1,0x039A,0x039B,0x039C,0x039D,0x039F,
1192 0x03A0,0x0398,0x03A1,0x03A3,0x03A4,0x03A5,0x03C2,0x03A9,
1193 0x039E,0x03A8,0x0396,0x005B,0x2234,0x005D,0x22A5,0x005F,
1194 0xF8E5,0x03B1,0x03B2,0x03C7,0x03B4,0x03B5,0x03C6,0x03B3,
1195 0x03B7,0x03B9,0x03D5,0x03BA,0x03BB,0x03BC,0x03BD,0x03BF,
1196 0x03C0,0x03B8,0x03C1,0x03C3,0x03C4,0x03C5,0x03D6,0x03C9,
1197 0x03BE,0x03C8,0x03B6,0x007B,0x007C,0x007D,0x223C,0xFFFF,
1198 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1199 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1200 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1201 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1202 0x20AC,0x03D2,0x2032,0x2264,0x2215,0x221E,0x0192,0x2663,
1203 0x2666,0x2665,0x2660,0x2194,0x2190,0x2191,0x2192,0x2193,
1204 0x00B0,0x00B1,0x2033,0x2265,0x00D7,0x221D,0x2202,0x2022,
1205 0x00F7,0x2260,0x2261,0x2248,0x2026,0x23AF,0x23D0,0x21B5,
1206 0x2135,0x2111,0x211C,0x2118,0x2297,0x2295,0x2205,0x2229,
1207 0x222A,0x2283,0x2287,0x2284,0x2282,0x2286,0x2208,0x2209,
1208 0x2220,0x2207,0xF6DA,0xF6D9,0xF6DB,0x220F,0x221A,0x22C5,
1209 0x00AC,0x2227,0x2228,0x21D4,0x21D0,0x21D1,0x21D2,0x21D3,
1210 0x25CA,0x2329,0xF8E8,0xF8E9,0xF8EA,0x2211,0x239B,0x239C,
1211 0x239D,0x23A1,0x23A2,0x23A3,0x23A7,0x23A8,0x23A9,0x23AA,
1212 0xFFFF,0x232A,0x222B,0x2320,0x23AE,0x2321,0x239E,0x239F,
1213 0x23A0,0x23A4,0x23A5,0x23A6,0x23AB,0x23AC,0x23AD,0xFFFF } },
1214 { RTL_TEXTENCODING_ADOBE_DINGBATS,
1215 { 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1216 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1217 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1218 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1219 // 20
1220 0x0020,0x2701,0x2702,0x2703,0x2704,0x260E,0x2706,0x2707,
1221 0x2708,0x2709,0x261B,0x261E,0x270C,0x270D,0x270E,0x270F,
1222 0x2710,0x2711,0x2712,0x2713,0x2714,0x2715,0x2716,0x2717,
1223 0x2718,0x2719,0x271A,0x271B,0x271C,0x271D,0x271E,0x271F,
1224 // 40
1225 0x2720,0x2721,0x2722,0x2723,0x2724,0x2725,0x2726,0x2727,
1226 0x2605,0x2729,0x272A,0x272B,0x272C,0x272D,0x272E,0x272F,
1227 0x2730,0x2731,0x2732,0x2733,0x2734,0x2735,0x2736,0x2737,
1228 0x2738,0x2739,0x273A,0x273B,0x273C,0x273D,0x273E,0x273F,
1229 // 60
1230 0x2740,0x2741,0x2742,0x2743,0x2744,0x2745,0x2746,0x2747,
1231 0x2748,0x2749,0x274A,0x274B,0x25CF,0x274D,0x25A0,0x274F,
1232 0x2750,0x2751,0x2752,0x25B2,0x25BC,0x25C6,0x2756,0x25D7,
1233 0x2758,0x2759,0x275A,0x275B,0x275C,0x275D,0x275E,0xFFFF,
1234 // 80
1235 0xF8D7,0xF8D8,0xF8D9,0xF8DA,0xF8DB,0xF8DC,0xF8DD,0xF8DE,
1236 0xF8DF,0xF8E0,0xF8E1,0xF8E2,0xF8E3,0xF8E4,0xFFFF,0xFFFF,
1237 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1238 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
1239 // A0
1240 0xFFFF,0x2761,0x2762,0x2763,0x2764,0x2765,0x2766,0x2767,
1241 0x2663,0x2666,0x2665,0x2660,0x2460,0x2461,0x2462,0x2463,
1242 0x2464,0x2465,0x2466,0x2467,0x2468,0x2469,0x2776,0x2777,
1243 0x2778,0x2779,0x277A,0x277B,0x277C,0x277D,0x277E,0x277F,
1244 // C0
1245 0x2780,0x2781,0x2782,0x2783,0x2784,0x2785,0x2786,0x2787,
1246 0x2788,0x2789,0x278A,0x278B,0x278C,0x278D,0x278E,0x278F,
1247 0x2790,0x2791,0x2792,0x2793,0x2794,0x2795,0x2796,0x2797,
1248 0x2798,0x2799,0x279A,0x279B,0x279C,0x279D,0x279E,0x279F,
1249 // E0
1250 0x27A0,0x27A1,0x27A2,0x27A3,0x27A4,0x27A5,0x27A6,0x27A7,
1251 0x27A8,0x27A9,0x27AA,0x27AB,0x27AC,0x27AD,0x27AE,0x27AF,
1252 0xFFFF,0x27B1,0x27B2,0x27B3,0x27B4,0x27B5,0x27B6,0x27B7,
1253 0x27B8,0x27B9,0x27BA,0x27BB,0x27BC,0x27BD,0x27BE,0xFFFF } },
1254 { RTL_TEXTENCODING_PT154,
1255 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
1256 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
1257 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
1258 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
1259 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
1260 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
1261 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
1262 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
1263 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
1264 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
1265 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
1266 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
1267 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
1268 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
1269 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
1270 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
1271 0x0496,0x0492,0x04EE,0x0493,0x201E,0x2026,0x04B6,0x04AE,
1272 0x04B2,0x04AF,0x04A0,0x04E2,0x04A2,0x049A,0x04BA,0x04B8,
1273 0x0497,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
1274 0x04B3,0x04B7,0x04A1,0x04E3,0x04A3,0x049B,0x04BB,0x04B9,
1275 0x00A0,0x040E,0x045E,0x0408,0x04E8,0x0498,0x04B0,0x00A7,
1276 0x0401,0x00A9,0x04D8,0x00AB,0x00AC,0x04EF,0x00AE,0x049C,
1277 0x00B0,0x04B1,0x0406,0x0456,0x0499,0x04E9,0x00B6,0x00B7,
1278 0x0451,0x2116,0x04D9,0x00BB,0x0458,0x04AA,0x04AB,0x049D,
1279 0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417,
1280 0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F,
1281 0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427,
1282 0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F,
1283 0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437,
1284 0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F,
1285 0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447,
1286 0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F } },
1287 { RTL_TEXTENCODING_KAMENICKY,
1288 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
1289 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
1290 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
1291 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
1292 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
1293 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
1294 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
1295 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
1296 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
1297 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
1298 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
1299 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
1300 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
1301 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
1302 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
1303 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
1304 0x010C,0x00FC,0x00E9,0x010F,0x00E4,0x010E,0x0164,0x010D,
1305 0x011B,0x011A,0x0139,0x00CD,0x013E,0x013A,0x00C4,0x00C1,
1306 0x00C9,0x017E,0x017D,0x00F4,0x00F6,0x00D3,0x016F,0x00DA,
1307 0x00FD,0x00D6,0x00DC,0x0160,0x013D,0x00DD,0x0158,0x0165,
1308 0x00E1,0x00ED,0x00F3,0x00FA,0x0148,0x0147,0x016E,0x00D4,
1309 0x0161,0x0159,0x0155,0x0154,0x00BC,0x00A7,0x00AB,0x00BB,
1310 0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556,
1311 0x2555,0x2563,0x2551,0x2557,0x255D,0x255C,0x255B,0x2510,
1312 0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x255E,0x255F,
1313 0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x2567,
1314 0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256B,
1315 0x256A,0x2518,0x250C,0x2588,0x2584,0x258C,0x2590,0x2580,
1316 0x03B1,0x00DF,0x0393,0x03C0,0x03A3,0x03C3,0x00B5,0x03C4,
1317 0x03A6,0x0398,0x03A9,0x03B4,0x221E,0x03C6,0x03B5,0x2229,
1318 0x2261,0x00B1,0x2265,0x2264,0x2320,0x2321,0x00F7,0x2248,
1319 0x00B0,0x2219,0x00B7,0x221A,0x207F,0x00B2,0x25A0,0x00A0 } },
1320 { RTL_TEXTENCODING_MAZOVIA,
1321 { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
1322 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
1323 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
1324 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
1325 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
1326 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
1327 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
1328 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
1329 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
1330 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
1331 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
1332 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
1333 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
1334 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
1335 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
1336 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
1337 0x00C7,0x00FC,0x00E9,0x00E2,0x00E4,0x00E0,0x0105,0x00E7,
1338 0x00EA,0x00EB,0x00E8,0x00EF,0x00EE,0x0107,0x00C4,0x0104,
1339 0x0118,0x0119,0x0142,0x00F4,0x00F6,0x0106,0x00FB,0x00F9,
1340 0x015A,0x00D6,0x00DC,0x00A2,0x0141,0x00A5,0x015B,0x0192,
1341 0x0179,0x017B,0x00F3,0x00D3,0x0144,0x0143,0x017A,0x017C,
1342 0x00BF,0x2310,0x00AC,0x00BD,0x00BC,0x00A1,0x00AB,0x00BB,
1343 0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556,
1344 0x2555,0x2563,0x2551,0x2557,0x255D,0x255C,0x255B,0x2510,
1345 0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x255E,0x255F,
1346 0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x2567,
1347 0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256B,
1348 0x256A,0x2518,0x250C,0x2588,0x2584,0x258C,0x2590,0x2580,
1349 0x03B1,0x00DF,0x0393,0x03C0,0x03A3,0x03C3,0x00B5,0x03C4,
1350 0x03A6,0x0398,0x03A9,0x03B4,0x221E,0x03C6,0x03B5,0x2229,
1351 0x2261,0x00B1,0x2265,0x2264,0x2320,0x2321,0x00F7,0x2248,
1352 0x00B0,0x2219,0x00B7,0x221A,0x207F,0x00B2,0x25A0,0x00A0 } } };
1353 for (auto const& aDatum : data)
1355 testSingleByteCharSet(aDatum);
1359 void Test::testComplex() {
1360 static ComplexCharSetTest const data[]
1361 = { { RTL_TEXTENCODING_ASCII_US,
1362 RTL_CONSTASCII_STRINGPARAM("\x01\"3De$~"),
1363 { 0x0001,0x0022,0x0033,0x0044,0x0065,0x0024,0x007E },
1365 true,
1366 true,
1367 true,
1368 false,
1369 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1370 #if WITH_LOCALE_ALL || WITH_LOCALE_zh
1371 { RTL_TEXTENCODING_EUC_CN,
1372 RTL_CONSTASCII_STRINGPARAM("\x01\"3De$~\xA1\xB9\xF0\xC5"),
1373 { 0x0001,0x0022,0x0033,0x0044,0x0065,0x0024,0x007E,
1374 0x300D,0x9E4B },
1376 true,
1377 true,
1378 true,
1379 false,
1380 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1381 { RTL_TEXTENCODING_EUC_TW,
1382 RTL_CONSTASCII_STRINGPARAM(
1383 "\x01\"3De$~\xC5\xF0\x8E\xA4\xDC\xD9"),
1384 { 0x0001,0x0022,0x0033,0x0044,0x0065,0x0024,0x007E,
1385 0x4ED9,0xD87E,0xDD68 },
1387 true,
1388 true,
1389 true,
1390 false,
1391 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1392 { RTL_TEXTENCODING_GB_18030,
1393 RTL_CONSTASCII_STRINGPARAM("\x01\"3De$~"),
1394 { 0x0001,0x0022,0x0033,0x0044,0x0065,0x0024,0x007E },
1396 true,
1397 true,
1398 true,
1399 false,
1400 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1401 { RTL_TEXTENCODING_GB_18030,
1402 RTL_CONSTASCII_STRINGPARAM("\x81\x40\xFE\xFE"),
1403 { 0x4E02,0xE4C5 },
1405 true,
1406 true,
1407 true,
1408 false,
1409 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1410 { RTL_TEXTENCODING_GB_18030,
1411 RTL_CONSTASCII_STRINGPARAM(
1412 "\x81\x30\xB1\x33\x81\x30\xD3\x30\x81\x36\xA5\x31"),
1413 { 0x028A,0x0452,0x200F },
1415 true,
1416 true,
1417 true,
1418 false,
1419 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1420 { RTL_TEXTENCODING_GB_18030,
1421 RTL_CONSTASCII_STRINGPARAM(
1422 "\xFE\x50\xFE\x51\xFE\x52\xFE\x53\xFE\x54\xFE\x55\xFE\x56"
1423 "\xFE\x57\xFE\x58\xFE\x59\xFE\x5A\xFE\x5B\xFE\x5C\xFE\x5D"
1424 "\xFE\x5E\xFE\x5F\xFE\x60\xFE\x61\xFE\x62\xFE\x63\xFE\x64"
1425 "\xFE\x65\xFE\x66\xFE\x67\xFE\x68\xFE\x69\xFE\x6A\xFE\x6B"
1426 "\xFE\x6C\xFE\x6D\xFE\x6E\xFE\x6F\xFE\x70\xFE\x71\xFE\x72"
1427 "\xFE\x73\xFE\x74\xFE\x75\xFE\x76\xFE\x77\xFE\x78\xFE\x79"
1428 "\xFE\x7A\xFE\x7B\xFE\x7C\xFE\x7D\xFE\x7E\xFE\x80\xFE\x81"
1429 "\xFE\x82\xFE\x83\xFE\x84\xFE\x85\xFE\x86\xFE\x87\xFE\x88"
1430 "\xFE\x89\xFE\x8A\xFE\x8B\xFE\x8C\xFE\x8D\xFE\x8E\xFE\x8F"
1431 "\xFE\x90\xFE\x91\xFE\x92\xFE\x93\xFE\x94\xFE\x95\xFE\x96"
1432 "\xFE\x97\xFE\x98\xFE\x99\xFE\x9A\xFE\x9B\xFE\x9C\xFE\x9D"
1433 "\xFE\x9E\xFE\x9F\xFE\xA0"),
1434 { 0x2E81,0xE816,0xE817,0xE818,0x2E84,0x3473,0x3447,0x2E88,
1435 0x2E8B,0xE81E,0x359E,0x361A,0x360E,0x2E8C,0x2E97,0x396E,
1436 0x3918,0xE826,0x39CF,0x39DF,0x3A73,0x39D0,0xE82B,0xE82C,
1437 0x3B4E,0x3C6E,0x3CE0,0x2EA7,0xE831,0xE832,0x2EAA,0x4056,
1438 0x415F,0x2EAE,0x4337,0x2EB3,0x2EB6,0x2EB7,0xE83B,0x43B1,
1439 0x43AC,0x2EBB,0x43DD,0x44D6,0x4661,0x464C,0xE843,0x4723,
1440 0x4729,0x477C,0x478D,0x2ECA,0x4947,0x497A,0x497D,0x4982,
1441 0x4983,0x4985,0x4986,0x499F,0x499B,0x49B7,0x49B6,0xE854,
1442 0xE855,0x4CA3,0x4C9F,0x4CA0,0x4CA1,0x4C77,0x4CA2,0x4D13,
1443 0x4D14,0x4D15,0x4D16,0x4D17,0x4D18,0x4D19,0x4DAE,0xE864 },
1445 true,
1446 true,
1447 false,
1448 false,
1449 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1450 #endif
1451 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
1452 { RTL_TEXTENCODING_ISO_2022_JP,
1453 RTL_CONSTASCII_STRINGPARAM("\x01\"3De$\\~"),
1454 { 0x0001,0x0022,0x0033,0x0044,0x0065,0x0024,0x005C,0x007E },
1456 false,
1457 true,
1458 true,
1459 false,
1460 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1461 { RTL_TEXTENCODING_ISO_2022_JP,
1462 RTL_CONSTASCII_STRINGPARAM("\x1B(B\x01\"3De$\\~"),
1463 { 0x0001,0x0022,0x0033,0x0044,0x0065,0x0024,0x005C,0x007E },
1465 false,
1466 true,
1467 false,
1468 false,
1469 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1470 { RTL_TEXTENCODING_ISO_2022_JP,
1471 RTL_CONSTASCII_STRINGPARAM("\x1B(J\x01\"3De$\\~"),
1472 { 0x0001,0x0022,0x0033,0x0044,0x0065,0x0024,0x00A5,0x00AF },
1474 false,
1475 true,
1476 false,
1477 false,
1478 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1479 { RTL_TEXTENCODING_ISO_2022_JP,
1480 RTL_CONSTASCII_STRINGPARAM("\x1B$B\x26\x21\x27\x71\x1B(B"),
1481 { 0x0391,0x044F },
1483 false,
1484 true,
1485 true,
1486 false,
1487 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1488 #endif
1489 #if WITH_LOCALE_ALL || WITH_LOCALE_ko
1490 { RTL_TEXTENCODING_ISO_2022_KR,
1491 RTL_CONSTASCII_STRINGPARAM("\x1B$)C\x01\"3De$\\~"),
1492 { 0x0001,0x0022,0x0033,0x0044,0x0065,0x0024,0x005C,0x007E },
1494 false,
1495 true,
1496 true,
1497 false,
1498 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1499 { RTL_TEXTENCODING_ISO_2022_KR,
1500 RTL_CONSTASCII_STRINGPARAM(
1501 "\x1B$)C\x0E\x25\x21\x0F\x0D\x0Ax\x0E\x48\x7E\x0F"),
1502 { 0x2170,0x000D,0x000A,0x0078,0xD79D },
1504 false,
1505 true,
1506 true,
1507 false,
1508 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1509 #endif
1510 #if WITH_LOCALE_ALL || WITH_LOCALE_zh
1511 { RTL_TEXTENCODING_ISO_2022_CN,
1512 RTL_CONSTASCII_STRINGPARAM(
1513 "\x01\"3De$\\~\x1B$)G\x0E\x45\x70\x1B$*H\x1BN\x22\x22"
1514 "\x45\x70\x0F\x1B$)A\x0E\x26\x21\x0F"),
1515 { 0x0001,0x0022,0x0033,0x0044,0x0065,0x0024,0x005C,0x007E,
1516 0x4ED9,0x531F,0x4ED9,0x0391 },
1518 false,
1519 true,
1520 false,
1521 false,
1522 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1523 { RTL_TEXTENCODING_ISO_2022_CN,
1524 RTL_CONSTASCII_STRINGPARAM(
1525 "\x01\"3De$\\~\x1B$)A\x0E\x26\x21\x1B$*H\x1BN\x22\x22"
1526 "\x26\x21\x0F\x0D\x0A\x1B$)A\x0E\x26\x21\x0F"),
1527 { 0x0001,0x0022,0x0033,0x0044,0x0065,0x0024,0x005C,0x007E,
1528 0x0391,0x531F,0x0391,0x000D,0x000A,0x0391 },
1530 false,
1531 true,
1532 true,
1533 false,
1534 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1535 #endif
1536 // The following does not work as long as Big5-HKSCS maps to
1537 // Unicode PUA instead of Plane 2. Use the next two tests
1538 // instead:
1539 // { RTL_TEXTENCODING_BIG5_HKSCS,
1540 // RTL_CONSTASCII_STRINGPARAM(
1541 // "\x01\"3De$~\x88\x56\xF9\xFE\xFA\x5E\xA1\x40\xF9\xD5"),
1542 // { 0x0001,0x0022,0x0033,0x0044,0x0065,0x0024,0x007E,0x0100,
1543 // 0xFFED,0xD849,0xDD13,0x3000,0x9F98 },
1544 // 13,
1545 // true,
1546 // true,
1547 // true,
1548 // false,
1549 // RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1550 #if WITH_LOCALE_ALL || WITH_LOCALE_zh
1551 { RTL_TEXTENCODING_BIG5_HKSCS,
1552 RTL_CONSTASCII_STRINGPARAM(
1553 "\x01\"3De$~\x88\x56\xF9\xFE\xFA\x5E\xA1\x40\xF9\xD5"),
1554 { 0x0001,0x0022,0x0033,0x0044,0x0065,0x0024,0x007E,0x0100,
1555 0xFFED,0xE01E,0x3000,0x9F98 },
1557 true,
1558 true,
1559 true,
1560 false,
1561 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1562 { RTL_TEXTENCODING_BIG5_HKSCS,
1563 RTL_CONSTASCII_STRINGPARAM(
1564 "\x01\"3De$~\x88\x56\xF9\xFE\xFA\x5E\xA1\x40\xF9\xD5"),
1565 { 0x0001,0x0022,0x0033,0x0044,0x0065,0x0024,0x007E,0x0100,
1566 0xFFED,0xD849,0xDD13,0x3000,0x9F98 },
1568 true,
1569 false,
1570 true,
1571 false,
1572 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1573 { RTL_TEXTENCODING_BIG5_HKSCS,
1574 RTL_CONSTASCII_STRINGPARAM(
1575 "\xC6\xA1\xC6\xCF\xC6\xD3\xC6\xD5\xC6\xD7\xC6\xDE\xC6\xDF"
1576 "\xC6\xFE\xC7\x40\xC7\x7E\xC7\xA1\xC7\xFE"),
1577 { 0x2460,0xF6E0,0xF6E4,0xF6E6,0xF6E8,0xF6EF,0xF6F0,0x3058,
1578 0x3059,0x30A4,0x30A5,0x041A },
1580 true,
1581 true,
1582 true,
1583 false,
1584 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1585 { RTL_TEXTENCODING_BIG5_HKSCS,
1586 RTL_CONSTASCII_STRINGPARAM("\x81\x40\x84\xFE"),
1587 { 0xEEB8,0xF12B },
1589 true,
1590 true,
1591 true,
1592 false,
1593 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1594 { RTL_TEXTENCODING_BIG5_HKSCS,
1595 RTL_CONSTASCII_STRINGPARAM(
1596 "\x81\x40\x8D\xFE\x8E\x40\xA0\xFE\xC6\xA1\xC8\xFE\xFA\x40"
1597 "\xFE\xFE"),
1598 { 0xEEB8,0xF6B0,0xE311,0xEEB7,0xF6B1,0xF848,0xE000,0xE310 },
1600 true,
1601 false,
1602 true,
1603 false,
1604 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1605 { RTL_TEXTENCODING_BIG5_HKSCS,
1606 RTL_CONSTASCII_STRINGPARAM("\xAD\xC5\x94\x55"),
1607 { 0x5029,0x7250 },
1609 true,
1610 true,
1611 true,
1612 false,
1613 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1614 { RTL_TEXTENCODING_BIG5_HKSCS,
1615 RTL_CONSTASCII_STRINGPARAM("\xFA\x5F\xA0\xE4"),
1616 { 0x5029,0x7250 },
1618 true,
1619 true,
1620 false,
1621 false,
1622 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1623 { RTL_TEXTENCODING_BIG5_HKSCS,
1624 RTL_CONSTASCII_STRINGPARAM("\xA0\x40\xA0\x7E\xA0\xA1\xA0\xFE"),
1625 { 0xEE1B,0xEE59,0xEE5A,0xEEB7 },
1627 true,
1628 false,
1629 true,
1630 false,
1631 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1632 { RTL_TEXTENCODING_BIG5,
1633 RTL_CONSTASCII_STRINGPARAM("\xA1\x45"),
1634 { 0x2027 },
1636 true,
1637 true,
1638 true,
1639 false,
1640 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1641 { RTL_TEXTENCODING_BIG5,
1642 RTL_CONSTASCII_STRINGPARAM(
1643 "\xC6\xCF\xC6\xD3\xC6\xD5\xC6\xD7\xC6\xDE\xC6\xDF"),
1644 { 0x306B,0x306F,0x3071,0x3073,0x307A,0x307B },
1646 true,
1647 true,
1648 true,
1649 false,
1650 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1651 { RTL_TEXTENCODING_BIG5,
1652 RTL_CONSTASCII_STRINGPARAM(
1653 "\xC7\xFD\xC7\xFE\xC8\x40\xC8\x7E\xC8\xA1\xC8\xFE"),
1654 { 0xF7AA,0xF7AB,0xF7AC,0xF7EA,0xF7EB,0xF848 },
1656 true,
1657 true,
1658 true,
1659 false,
1660 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1661 { RTL_TEXTENCODING_BIG5,
1662 RTL_CONSTASCII_STRINGPARAM("\xA0\x40\xA0\x7E\xA0\xA1\xA0\xFE"),
1663 { 0xEE1B,0xEE59,0xEE5A,0xEEB7 },
1665 true,
1666 true,
1667 true,
1668 false,
1669 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1670 #endif
1671 { RTL_TEXTENCODING_MS_950,
1672 RTL_CONSTASCII_STRINGPARAM(
1673 "\xC6\xA1\xC6\xFE\xC7\x40\xC7\x7E\xC7\xA1\xC7\xFE\xC8\x40"
1674 "\xC8\x7E\xC8\xA1\xC8\xFE"),
1675 { 0xF6B1,0xF70E,0xF70F,0xF74D,0xF74E,0xF7AB,0xF7AC,0xF7EA,
1676 0xF7EB,0xF848 },
1678 true,
1679 true,
1680 true,
1681 false,
1682 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1683 { RTL_TEXTENCODING_MS_950,
1684 RTL_CONSTASCII_STRINGPARAM("\xA0\x40\xA0\x7E\xA0\xA1\xA0\xFE"),
1685 { 0xEE1B,0xEE59,0xEE5A,0xEEB7 },
1687 true,
1688 true,
1689 true,
1690 false,
1691 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1693 // Test Unicode beyond BMP:
1695 // FIXME The second m_bForward test (requiring a context) does not
1696 // work for UTF7:
1697 // { RTL_TEXTENCODING_UTF7,
1698 // RTL_CONSTASCII_STRINGPARAM("+2EndEw-"),
1699 // { 0xD849,0xDD13 },
1700 // 2,
1701 // true,
1702 // true,
1703 // true,
1704 // false,
1705 // RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1706 { RTL_TEXTENCODING_UTF8,
1707 RTL_CONSTASCII_STRINGPARAM("\xF0\xA2\x94\x93"),
1708 { 0xD849,0xDD13 },
1710 true,
1711 true,
1712 true,
1713 false,
1714 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1715 #if WITH_LOCALE_ALL || WITH_LOCALE_zh
1716 { RTL_TEXTENCODING_GB_18030,
1717 RTL_CONSTASCII_STRINGPARAM("\x95\x39\xC5\x37"),
1718 { 0xD849,0xDD13 },
1720 true,
1721 true,
1722 true,
1723 false,
1724 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1725 { RTL_TEXTENCODING_BIG5_HKSCS,
1726 RTL_CONSTASCII_STRINGPARAM("\xFA\x5E"),
1727 { 0xD849,0xDD13 },
1729 true,
1730 false,
1731 true,
1732 false,
1733 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1735 // Test GBK (aka CP936):
1737 { RTL_TEXTENCODING_GBK,
1738 RTL_CONSTASCII_STRINGPARAM("\xFD\x7C\xC1\xFA\xFD\x9B"),
1739 { 0x9F76,0x9F99,0x9FA5 },
1741 true,
1742 true,
1743 true,
1744 false,
1745 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1746 #endif
1747 { RTL_TEXTENCODING_MS_936,
1748 RTL_CONSTASCII_STRINGPARAM("\xFD\x7C\xC1\xFA\xFD\x9B"),
1749 { 0x9F76,0x9F99,0x9FA5 },
1751 true,
1752 true,
1753 true,
1754 false,
1755 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1756 #if WITH_LOCALE_ALL || WITH_LOCALE_zh
1757 { RTL_TEXTENCODING_GBK,
1758 RTL_CONSTASCII_STRINGPARAM(
1759 "\xFE\x50\xFE\x54\xFE\x55\xFE\x56"
1760 "\xFE\x57\xFE\x58\xFE\x5A\xFE\x5B\xFE\x5C\xFE\x5D"
1761 "\xFE\x5E\xFE\x5F\xFE\x60\xFE\x62\xFE\x63\xFE\x64"
1762 "\xFE\x65\xFE\x68\xFE\x69\xFE\x6A\xFE\x6B"
1763 "\xFE\x6E\xFE\x6F\xFE\x70\xFE\x71\xFE\x72"
1764 "\xFE\x73\xFE\x74\xFE\x75\xFE\x77\xFE\x78\xFE\x79"
1765 "\xFE\x7A\xFE\x7B\xFE\x7C\xFE\x7D\xFE\x80\xFE\x81"
1766 "\xFE\x82\xFE\x83\xFE\x84\xFE\x85\xFE\x86\xFE\x87\xFE\x88"
1767 "\xFE\x89\xFE\x8A\xFE\x8B\xFE\x8C\xFE\x8D\xFE\x8E\xFE\x8F"
1768 "\xFE\x92\xFE\x93\xFE\x94\xFE\x95\xFE\x96"
1769 "\xFE\x97\xFE\x98\xFE\x99\xFE\x9A\xFE\x9B\xFE\x9C\xFE\x9D"
1770 "\xFE\x9E\xFE\x9F"),
1771 { 0x2E81,0x2E84,0x3473,0x3447,0x2E88,0x2E8B,0x359E,0x361A,
1772 0x360E,0x2E8C,0x2E97,0x396E,0x3918,0x39CF,0x39DF,0x3A73,
1773 0x39D0,0x3B4E,0x3C6E,0x3CE0,0x2EA7,0x2EAA,0x4056,0x415F,
1774 0x2EAE,0x4337,0x2EB3,0x2EB6,0x2EB7,0x43B1,0x43AC,0x2EBB,
1775 0x43DD,0x44D6,0x4661,0x464C,0x4723,0x4729,0x477C,0x478D,
1776 0x2ECA,0x4947,0x497A,0x497D,0x4982,0x4983,0x4985,0x4986,
1777 0x499F,0x499B,0x49B7,0x49B6,0x4CA3,0x4C9F,0x4CA0,0x4CA1,
1778 0x4C77,0x4CA2,0x4D13,0x4D14,0x4D15,0x4D16,0x4D17,0x4D18,
1779 0x4D19,0x4DAE },
1781 true,
1782 true,
1783 true,
1784 false,
1785 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1786 #endif
1787 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
1788 { RTL_TEXTENCODING_EUC_JP,
1789 RTL_CONSTASCII_STRINGPARAM("?"),
1790 { 0xFF0D },
1792 true,
1793 false,
1794 true,
1795 false,
1796 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_QUESTIONMARK },
1797 #endif
1798 // Test of "JIS X 0208 row 13" (taken from CP932; added to
1799 // ISO-2022-JP and EUC-JP; 74 of the 83 characters introduce
1800 // mappings to new Unicode characters):
1801 { RTL_TEXTENCODING_MS_932,
1802 RTL_CONSTASCII_STRINGPARAM(
1803 "\x87\x40\x87\x41\x87\x42\x87\x43\x87\x44\x87\x45\x87\x46"
1804 "\x87\x47\x87\x48\x87\x49\x87\x4A\x87\x4B\x87\x4C\x87\x4D"
1805 "\x87\x4E\x87\x4F\x87\x50\x87\x51\x87\x52\x87\x53\x87\x54"
1806 "\x87\x55\x87\x56\x87\x57\x87\x58\x87\x59\x87\x5A\x87\x5B"
1807 "\x87\x5C\x87\x5D\x87\x5F\x87\x60\x87\x61\x87\x62\x87\x63"
1808 "\x87\x64\x87\x65\x87\x66\x87\x67\x87\x68\x87\x69\x87\x6A"
1809 "\x87\x6B\x87\x6C\x87\x6D\x87\x6E\x87\x6F\x87\x70\x87\x71"
1810 "\x87\x72\x87\x73\x87\x74\x87\x75\x87\x7E\x87\x80\x87\x81"
1811 "\x87\x82\x87\x83\x87\x84\x87\x85\x87\x86\x87\x87\x87\x88"
1812 "\x87\x89\x87\x8A\x87\x8B\x87\x8C\x87\x8D\x87\x8E\x87\x8F"
1813 "\x87\x90\x87\x91\x87\x92\x87\x93\x87\x94\x87\x95\x87\x96"
1814 "\x87\x97\x87\x98\x87\x99\x87\x9A\x87\x9B\x87\x9C"),
1815 { 0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467,0x2468,
1816 0x2469,0x246A,0x246B,0x246C,0x246D,0x246E,0x246F,0x2470,0x2471,
1817 0x2472,0x2473,0x2160,0x2161,0x2162,0x2163,0x2164,0x2165,0x2166,
1818 0x2167,0x2168,0x2169,0x3349,0x3314,0x3322,0x334D,0x3318,0x3327,
1819 0x3303,0x3336,0x3351,0x3357,0x330D,0x3326,0x3323,0x332B,0x334A,
1820 0x333B,0x339C,0x339D,0x339E,0x338E,0x338F,0x33C4,0x33A1,0x337B,
1821 0x301D,0x301F,0x2116,0x33CD,0x2121,0x32A4,0x32A5,0x32A6,0x32A7,
1822 0x32A8,0x3231,0x3232,0x3239,0x337E,0x337D,0x337C,0x2252,0x2261,
1823 0x222B,0x222E,0x2211,0x221A,0x22A5,0x2220,0x221F,0x22BF,0x2235,
1824 0x2229,0x222A },
1826 true,
1827 true,
1828 false,
1829 false,
1830 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1831 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
1832 { RTL_TEXTENCODING_SHIFT_JIS,
1833 RTL_CONSTASCII_STRINGPARAM("\x00\xFA\x6F\xFA\x71"),
1834 {0x0000, 0x4F92, 0x4F9A},
1836 true,
1837 true,
1838 true,
1839 false,
1840 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1841 { RTL_TEXTENCODING_SHIFT_JIS,
1842 RTL_CONSTASCII_STRINGPARAM(
1843 "\x87\x40\x87\x41\x87\x42\x87\x43\x87\x44\x87\x45\x87\x46"
1844 "\x87\x47\x87\x48\x87\x49\x87\x4A\x87\x4B\x87\x4C\x87\x4D"
1845 "\x87\x4E\x87\x4F\x87\x50\x87\x51\x87\x52\x87\x53\x87\x54"
1846 "\x87\x55\x87\x56\x87\x57\x87\x58\x87\x59\x87\x5A\x87\x5B"
1847 "\x87\x5C\x87\x5D\x87\x5F\x87\x60\x87\x61\x87\x62\x87\x63"
1848 "\x87\x64\x87\x65\x87\x66\x87\x67\x87\x68\x87\x69\x87\x6A"
1849 "\x87\x6B\x87\x6C\x87\x6D\x87\x6E\x87\x6F\x87\x70\x87\x71"
1850 "\x87\x72\x87\x73\x87\x74\x87\x75\x87\x7E\x87\x80\x87\x81"
1851 "\x87\x82\x87\x83\x87\x84\x87\x85\x87\x86\x87\x87\x87\x88"
1852 "\x87\x89\x87\x8A\x87\x8B\x87\x8C\x87\x8D\x87\x8E\x87\x8F"
1853 "\x87\x90\x87\x91\x87\x92\x87\x93\x87\x94\x87\x95\x87\x96"
1854 "\x87\x97\x87\x98\x87\x99\x87\x9A\x87\x9B\x87\x9C"),
1855 { 0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467,0x2468,
1856 0x2469,0x246A,0x246B,0x246C,0x246D,0x246E,0x246F,0x2470,0x2471,
1857 0x2472,0x2473,0x2160,0x2161,0x2162,0x2163,0x2164,0x2165,0x2166,
1858 0x2167,0x2168,0x2169,0x3349,0x3314,0x3322,0x334D,0x3318,0x3327,
1859 0x3303,0x3336,0x3351,0x3357,0x330D,0x3326,0x3323,0x332B,0x334A,
1860 0x333B,0x339C,0x339D,0x339E,0x338E,0x338F,0x33C4,0x33A1,0x337B,
1861 0x301D,0x301F,0x2116,0x33CD,0x2121,0x32A4,0x32A5,0x32A6,0x32A7,
1862 0x32A8,0x3231,0x3232,0x3239,0x337E,0x337D,0x337C,0x2252,0x2261,
1863 0x222B,0x222E,0x2211,0x221A,0x22A5,0x2220,0x221F,0x22BF,0x2235,
1864 0x2229,0x222A },
1866 true,
1867 true,
1868 false,
1869 false,
1870 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1871 { RTL_TEXTENCODING_ISO_2022_JP,
1872 RTL_CONSTASCII_STRINGPARAM(
1873 "\x1B$B\x2D\x21\x2D\x22\x2D\x23\x2D\x24\x2D\x25\x2D\x26"
1874 "\x2D\x27\x2D\x28\x2D\x29\x2D\x2A\x2D\x2B\x2D\x2C\x2D\x2D"
1875 "\x2D\x2E\x2D\x2F\x2D\x30\x2D\x31\x2D\x32\x2D\x33\x2D\x34"
1876 "\x2D\x35\x2D\x36\x2D\x37\x2D\x38\x2D\x39\x2D\x3A\x2D\x3B"
1877 "\x2D\x3C\x2D\x3D\x2D\x3E\x2D\x40\x2D\x41\x2D\x42\x2D\x43"
1878 "\x2D\x44\x2D\x45\x2D\x46\x2D\x47\x2D\x48\x2D\x49\x2D\x4A"
1879 "\x2D\x4B\x2D\x4C\x2D\x4D\x2D\x4E\x2D\x4F\x2D\x50\x2D\x51"
1880 "\x2D\x52\x2D\x53\x2D\x54\x2D\x55\x2D\x56\x2D\x5F\x2D\x60"
1881 "\x2D\x61\x2D\x62\x2D\x63\x2D\x64\x2D\x65\x2D\x66\x2D\x67"
1882 "\x2D\x68\x2D\x69\x2D\x6A\x2D\x6B\x2D\x6C\x2D\x6D\x2D\x6E"
1883 "\x2D\x6F\x2D\x70\x2D\x71\x2D\x72\x2D\x73\x2D\x74\x2D\x75"
1884 "\x2D\x76\x2D\x77\x2D\x78\x2D\x79\x2D\x7A\x2D\x7B\x2D\x7C"
1885 "\x1B(B"),
1886 { 0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467,0x2468,
1887 0x2469,0x246A,0x246B,0x246C,0x246D,0x246E,0x246F,0x2470,0x2471,
1888 0x2472,0x2473,0x2160,0x2161,0x2162,0x2163,0x2164,0x2165,0x2166,
1889 0x2167,0x2168,0x2169,0x3349,0x3314,0x3322,0x334D,0x3318,0x3327,
1890 0x3303,0x3336,0x3351,0x3357,0x330D,0x3326,0x3323,0x332B,0x334A,
1891 0x333B,0x339C,0x339D,0x339E,0x338E,0x338F,0x33C4,0x33A1,0x337B,
1892 0x301D,0x301F,0x2116,0x33CD,0x2121,0x32A4,0x32A5,0x32A6,0x32A7,
1893 0x32A8,0x3231,0x3232,0x3239,0x337E,0x337D,0x337C,0x2252,0x2261,
1894 0x222B,0x222E,0x2211,0x221A,0x22A5,0x2220,0x221F,0x22BF,0x2235,
1895 0x2229,0x222A },
1897 false,
1898 true,
1899 false,
1900 false,
1901 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1902 { RTL_TEXTENCODING_ISO_2022_JP,
1903 RTL_CONSTASCII_STRINGPARAM(
1904 "\x1B$B\x2D\x21\x2D\x22\x2D\x23\x2D\x24\x2D\x25\x2D\x26"
1905 "\x2D\x27\x2D\x28\x2D\x29\x2D\x2A\x2D\x2B\x2D\x2C\x2D\x2D"
1906 "\x2D\x2E\x2D\x2F\x2D\x30\x2D\x31\x2D\x32\x2D\x33\x2D\x34"
1907 "\x2D\x35\x2D\x36\x2D\x37\x2D\x38\x2D\x39\x2D\x3A\x2D\x3B"
1908 "\x2D\x3C\x2D\x3D\x2D\x3E\x2D\x40\x2D\x41\x2D\x42\x2D\x43"
1909 "\x2D\x44\x2D\x45\x2D\x46\x2D\x47\x2D\x48\x2D\x49\x2D\x4A"
1910 "\x2D\x4B\x2D\x4C\x2D\x4D\x2D\x4E\x2D\x4F\x2D\x50\x2D\x51"
1911 "\x2D\x52\x2D\x53\x2D\x54\x2D\x55\x2D\x56\x2D\x5F\x2D\x60"
1912 "\x2D\x61\x2D\x62\x2D\x63\x2D\x64\x2D\x65\x2D\x66\x2D\x67"
1913 "\x2D\x68\x2D\x69\x2D\x6A\x2D\x6B\x2D\x6C\x2D\x6D\x2D\x6E"
1914 "\x2D\x6F\x2D\x73\x2D\x74\x2D\x78\x2D\x79\x1B(B"),
1915 { 0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467,0x2468,
1916 0x2469,0x246A,0x246B,0x246C,0x246D,0x246E,0x246F,0x2470,0x2471,
1917 0x2472,0x2473,0x2160,0x2161,0x2162,0x2163,0x2164,0x2165,0x2166,
1918 0x2167,0x2168,0x2169,0x3349,0x3314,0x3322,0x334D,0x3318,0x3327,
1919 0x3303,0x3336,0x3351,0x3357,0x330D,0x3326,0x3323,0x332B,0x334A,
1920 0x333B,0x339C,0x339D,0x339E,0x338E,0x338F,0x33C4,0x33A1,0x337B,
1921 0x301D,0x301F,0x2116,0x33CD,0x2121,0x32A4,0x32A5,0x32A6,0x32A7,
1922 0x32A8,0x3231,0x3232,0x3239,0x337E,0x337D,0x337C,0x222E,0x2211,
1923 0x221F,0x22BF },
1925 false,
1926 true,
1927 true,
1928 false,
1929 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1930 { RTL_TEXTENCODING_EUC_JP,
1931 RTL_CONSTASCII_STRINGPARAM(
1932 "\xAD\xA1\xAD\xA2\xAD\xA3\xAD\xA4\xAD\xA5\xAD\xA6\xAD\xA7"
1933 "\xAD\xA8\xAD\xA9\xAD\xAA\xAD\xAB\xAD\xAC\xAD\xAD\xAD\xAE"
1934 "\xAD\xAF\xAD\xB0\xAD\xB1\xAD\xB2\xAD\xB3\xAD\xB4\xAD\xB5"
1935 "\xAD\xB6\xAD\xB7\xAD\xB8\xAD\xB9\xAD\xBA\xAD\xBB\xAD\xBC"
1936 "\xAD\xBD\xAD\xBE\xAD\xC0\xAD\xC1\xAD\xC2\xAD\xC3\xAD\xC4"
1937 "\xAD\xC5\xAD\xC6\xAD\xC7\xAD\xC8\xAD\xC9\xAD\xCA\xAD\xCB"
1938 "\xAD\xCC\xAD\xCD\xAD\xCE\xAD\xCF\xAD\xD0\xAD\xD1\xAD\xD2"
1939 "\xAD\xD3\xAD\xD4\xAD\xD5\xAD\xD6\xAD\xDF\xAD\xE0\xAD\xE1"
1940 "\xAD\xE2\xAD\xE3\xAD\xE4\xAD\xE5\xAD\xE6\xAD\xE7\xAD\xE8"
1941 "\xAD\xE9\xAD\xEA\xAD\xEB\xAD\xEC\xAD\xED\xAD\xEE\xAD\xEF"
1942 "\xAD\xF0\xAD\xF1\xAD\xF2\xAD\xF3\xAD\xF4\xAD\xF5\xAD\xF6"
1943 "\xAD\xF7\xAD\xF8\xAD\xF9\xAD\xFA\xAD\xFB\xAD\xFC"),
1944 { 0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467,0x2468,
1945 0x2469,0x246A,0x246B,0x246C,0x246D,0x246E,0x246F,0x2470,0x2471,
1946 0x2472,0x2473,0x2160,0x2161,0x2162,0x2163,0x2164,0x2165,0x2166,
1947 0x2167,0x2168,0x2169,0x3349,0x3314,0x3322,0x334D,0x3318,0x3327,
1948 0x3303,0x3336,0x3351,0x3357,0x330D,0x3326,0x3323,0x332B,0x334A,
1949 0x333B,0x339C,0x339D,0x339E,0x338E,0x338F,0x33C4,0x33A1,0x337B,
1950 0x301D,0x301F,0x2116,0x33CD,0x2121,0x32A4,0x32A5,0x32A6,0x32A7,
1951 0x32A8,0x3231,0x3232,0x3239,0x337E,0x337D,0x337C,0x2252,0x2261,
1952 0x222B,0x222E,0x2211,0x221A,0x22A5,0x2220,0x221F,0x22BF,0x2235,
1953 0x2229,0x222A },
1955 true,
1956 true,
1957 false,
1958 false,
1959 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1960 { RTL_TEXTENCODING_EUC_JP,
1961 RTL_CONSTASCII_STRINGPARAM(
1962 "\xAD\xA1\xAD\xA2\xAD\xA3\xAD\xA4\xAD\xA5\xAD\xA6\xAD\xA7"
1963 "\xAD\xA8\xAD\xA9\xAD\xAA\xAD\xAB\xAD\xAC\xAD\xAD\xAD\xAE"
1964 "\xAD\xAF\xAD\xB0\xAD\xB1\xAD\xB2\xAD\xB3\xAD\xB4\xAD\xB5"
1965 "\xAD\xB6\xAD\xB7\xAD\xB8\xAD\xB9\xAD\xBA\xAD\xBB\xAD\xBC"
1966 "\xAD\xBD\xAD\xBE\xAD\xC0\xAD\xC1\xAD\xC2\xAD\xC3\xAD\xC4"
1967 "\xAD\xC5\xAD\xC6\xAD\xC7\xAD\xC8\xAD\xC9\xAD\xCA\xAD\xCB"
1968 "\xAD\xCC\xAD\xCD\xAD\xCE\xAD\xCF\xAD\xD0\xAD\xD1\xAD\xD2"
1969 "\xAD\xD3\xAD\xD4\xAD\xD5\xAD\xD6\xAD\xDF\xAD\xE0\xAD\xE1"
1970 "\xAD\xE2\xAD\xE3\xAD\xE4\xAD\xE5\xAD\xE6\xAD\xE7\xAD\xE8"
1971 "\xAD\xE9\xAD\xEA\xAD\xEB\xAD\xEC\xAD\xED\xAD\xEE\xAD\xEF"
1972 "\xAD\xF3\xAD\xF4\xAD\xF8\xAD\xF9"),
1973 { 0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467,0x2468,
1974 0x2469,0x246A,0x246B,0x246C,0x246D,0x246E,0x246F,0x2470,0x2471,
1975 0x2472,0x2473,0x2160,0x2161,0x2162,0x2163,0x2164,0x2165,0x2166,
1976 0x2167,0x2168,0x2169,0x3349,0x3314,0x3322,0x334D,0x3318,0x3327,
1977 0x3303,0x3336,0x3351,0x3357,0x330D,0x3326,0x3323,0x332B,0x334A,
1978 0x333B,0x339C,0x339D,0x339E,0x338E,0x338F,0x33C4,0x33A1,0x337B,
1979 0x301D,0x301F,0x2116,0x33CD,0x2121,0x32A4,0x32A5,0x32A6,0x32A7,
1980 0x32A8,0x3231,0x3232,0x3239,0x337E,0x337D,0x337C,0x222E,0x2211,
1981 0x221F,0x22BF },
1983 true,
1984 true,
1985 true,
1986 false,
1987 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1989 { RTL_TEXTENCODING_EUC_JP,
1990 RTL_CONSTASCII_STRINGPARAM("\xB9\xF5"),
1991 { 0x9ED2 },
1993 true,
1994 true,
1995 true,
1996 false,
1997 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
1998 #endif
1999 // Test ISO-8859-x/MS-125x range 0x80--9F:
2001 { RTL_TEXTENCODING_ISO_8859_1,
2002 RTL_CONSTASCII_STRINGPARAM(
2003 "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E"
2004 "\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D"
2005 "\x9E\x9F"),
2006 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2007 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2008 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2009 0x009B,0x009C,0x009D,0x009E,0x009F },
2011 true,
2012 true,
2013 true,
2014 false,
2015 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2016 { RTL_TEXTENCODING_ISO_8859_2,
2017 RTL_CONSTASCII_STRINGPARAM(
2018 "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E"
2019 "\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D"
2020 "\x9E\x9F"),
2021 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2022 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2023 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2024 0x009B,0x009C,0x009D,0x009E,0x009F },
2026 true,
2027 true,
2028 true,
2029 false,
2030 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2031 { RTL_TEXTENCODING_ISO_8859_3,
2032 RTL_CONSTASCII_STRINGPARAM(
2033 "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E"
2034 "\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D"
2035 "\x9E\x9F"),
2036 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2037 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2038 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2039 0x009B,0x009C,0x009D,0x009E,0x009F },
2041 true,
2042 true,
2043 true,
2044 false,
2045 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2046 { RTL_TEXTENCODING_ISO_8859_4,
2047 RTL_CONSTASCII_STRINGPARAM(
2048 "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E"
2049 "\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D"
2050 "\x9E\x9F"),
2051 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2052 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2053 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2054 0x009B,0x009C,0x009D,0x009E,0x009F },
2056 true,
2057 true,
2058 true,
2059 false,
2060 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2061 { RTL_TEXTENCODING_ISO_8859_5,
2062 RTL_CONSTASCII_STRINGPARAM(
2063 "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E"
2064 "\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D"
2065 "\x9E\x9F"),
2066 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2067 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2068 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2069 0x009B,0x009C,0x009D,0x009E,0x009F },
2071 true,
2072 true,
2073 true,
2074 false,
2075 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2076 { RTL_TEXTENCODING_ISO_8859_6,
2077 RTL_CONSTASCII_STRINGPARAM(
2078 "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E"
2079 "\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D"
2080 "\x9E\x9F"),
2081 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2082 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2083 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2084 0x009B,0x009C,0x009D,0x009E,0x009F },
2086 true,
2087 true,
2088 true,
2089 false,
2090 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2091 { RTL_TEXTENCODING_ISO_8859_7,
2092 RTL_CONSTASCII_STRINGPARAM(
2093 "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E"
2094 "\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D"
2095 "\x9E\x9F"),
2096 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2097 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2098 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2099 0x009B,0x009C,0x009D,0x009E,0x009F },
2101 true,
2102 true,
2103 true,
2104 false,
2105 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2106 { RTL_TEXTENCODING_ISO_8859_8,
2107 RTL_CONSTASCII_STRINGPARAM(
2108 "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E"
2109 "\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D"
2110 "\x9E\x9F"),
2111 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2112 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2113 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2114 0x009B,0x009C,0x009D,0x009E,0x009F },
2116 true,
2117 true,
2118 true,
2119 false,
2120 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2121 { RTL_TEXTENCODING_ISO_8859_9,
2122 RTL_CONSTASCII_STRINGPARAM(
2123 "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E"
2124 "\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D"
2125 "\x9E\x9F"),
2126 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2127 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2128 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2129 0x009B,0x009C,0x009D,0x009E,0x009F },
2131 true,
2132 true,
2133 true,
2134 false,
2135 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2136 { RTL_TEXTENCODING_ISO_8859_14,
2137 RTL_CONSTASCII_STRINGPARAM(
2138 "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E"
2139 "\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D"
2140 "\x9E\x9F"),
2141 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2142 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2143 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2144 0x009B,0x009C,0x009D,0x009E,0x009F },
2146 true,
2147 true,
2148 true,
2149 false,
2150 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2151 { RTL_TEXTENCODING_ISO_8859_15,
2152 RTL_CONSTASCII_STRINGPARAM(
2153 "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E"
2154 "\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D"
2155 "\x9E\x9F"),
2156 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2157 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2158 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2159 0x009B,0x009C,0x009D,0x009E,0x009F },
2161 true,
2162 true,
2163 true,
2164 false,
2165 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2166 { RTL_TEXTENCODING_MS_874,
2167 RTL_CONSTASCII_STRINGPARAM(""),
2168 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2169 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2170 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2171 0x009B,0x009C,0x009D,0x009E,0x009F },
2173 true,
2174 false,
2175 true,
2176 false,
2177 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_IGNORE },
2178 { RTL_TEXTENCODING_MS_1250,
2179 RTL_CONSTASCII_STRINGPARAM(""),
2180 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2181 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2182 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2183 0x009B,0x009C,0x009D,0x009E,0x009F },
2185 true,
2186 false,
2187 true,
2188 false,
2189 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_IGNORE },
2190 { RTL_TEXTENCODING_MS_1251,
2191 RTL_CONSTASCII_STRINGPARAM(""),
2192 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2193 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2194 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2195 0x009B,0x009C,0x009D,0x009E,0x009F },
2197 true,
2198 false,
2199 true,
2200 false,
2201 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_IGNORE },
2202 { RTL_TEXTENCODING_MS_1252,
2203 RTL_CONSTASCII_STRINGPARAM(""),
2204 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2205 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2206 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2207 0x009B,0x009C,0x009D,0x009E,0x009F },
2209 true,
2210 false,
2211 true,
2212 false,
2213 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_IGNORE },
2214 { RTL_TEXTENCODING_MS_1253,
2215 RTL_CONSTASCII_STRINGPARAM(""),
2216 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2217 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2218 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2219 0x009B,0x009C,0x009D,0x009E,0x009F },
2221 true,
2222 false,
2223 true,
2224 false,
2225 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_IGNORE },
2226 { RTL_TEXTENCODING_MS_1254,
2227 RTL_CONSTASCII_STRINGPARAM(""),
2228 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2229 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2230 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2231 0x009B,0x009C,0x009D,0x009E,0x009F },
2233 true,
2234 false,
2235 true,
2236 false,
2237 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_IGNORE },
2238 { RTL_TEXTENCODING_MS_1255,
2239 RTL_CONSTASCII_STRINGPARAM(""),
2240 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2241 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2242 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2243 0x009B,0x009C,0x009D,0x009E,0x009F },
2245 true,
2246 false,
2247 true,
2248 false,
2249 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_IGNORE },
2250 { RTL_TEXTENCODING_MS_1256,
2251 RTL_CONSTASCII_STRINGPARAM(""),
2252 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2253 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2254 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2255 0x009B,0x009C,0x009D,0x009E,0x009F },
2257 true,
2258 false,
2259 true,
2260 false,
2261 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_IGNORE },
2262 { RTL_TEXTENCODING_MS_1257,
2263 RTL_CONSTASCII_STRINGPARAM(""),
2264 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2265 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2266 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2267 0x009B,0x009C,0x009D,0x009E,0x009F },
2269 true,
2270 false,
2271 true,
2272 false,
2273 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_IGNORE },
2274 { RTL_TEXTENCODING_MS_1258,
2275 RTL_CONSTASCII_STRINGPARAM(""),
2276 { 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,
2277 0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,
2278 0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009A,
2279 0x009B,0x009C,0x009D,0x009E,0x009F },
2281 true,
2282 false,
2283 true,
2284 false,
2285 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_IGNORE },
2286 { RTL_TEXTENCODING_MS_949,
2287 RTL_CONSTASCII_STRINGPARAM(
2288 "\xB0\xA1\xB0\xA2\x81\x41\x81\x42\xB0\xA3\x81\x43\x81\x44"
2289 "\xB0\xA4\xB0\xA5\xB0\xA6\xB0\xA7\x81\x45\x81\x46\x81\x47"
2290 "\x81\x48\x81\x49\xB0\xA8\xB0\xA9\xB0\xAA\xB0\xAB\xB0\xAC"
2291 "\xB0\xAD\xB0\xAE\xB0\xAF\x81\x4A\xB0\xB0\xB0\xB1\xB0\xB2"),
2292 { 0xAC00,0xAC01,0xAC02,0xAC03,0xAC04,0xAC05,0xAC06,0xAC07,0xAC08,
2293 0xAC09,0xAC0A,0xAC0B,0xAC0C,0xAC0D,0xAC0E,0xAC0F,0xAC10,0xAC11,
2294 0xAC12,0xAC13,0xAC14,0xAC15,0xAC16,0xAC17,0xAC18,0xAC19,0xAC1A,
2295 0xAC1B },
2297 true,
2298 true,
2299 true,
2300 false,
2301 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2302 { RTL_TEXTENCODING_MS_949,
2303 RTL_CONSTASCII_STRINGPARAM(
2304 "\xC9\xA1\xC9\xA2\xC9\xA3\xC9\xFC\xC9\xFD\xC9\xFE"
2305 "\xFE\xA1\xFE\xA2\xFE\xA3\xFE\xFC\xFE\xFD\xFE\xFE"),
2306 { 0xE000,0xE001,0xE002,0xE05B,0xE05C,0xE05D,
2307 0xE05E,0xE05F,0xE060,0xE0B9,0xE0BA,0xE0BB },
2309 true,
2310 true,
2311 true,
2312 false,
2313 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2314 #if WITH_LOCALE_ALL || WITH_LOCALE_ko
2315 { RTL_TEXTENCODING_EUC_KR,
2316 RTL_CONSTASCII_STRINGPARAM(
2317 "\xB0\xA1\xB0\xA2" "\xB0\xA3"
2318 "\xB0\xA4\xB0\xA5\xB0\xA6\xB0\xA7"
2319 "\xB0\xA8\xB0\xA9\xB0\xAA\xB0\xAB\xB0\xAC"
2320 "\xB0\xAD\xB0\xAE\xB0\xAF" "\xB0\xB0\xB0\xB1\xB0\xB2"),
2321 { 0xAC00,0xAC01, 0xAC04, 0xAC07,0xAC08,
2322 0xAC09,0xAC0A, 0xAC10,0xAC11,
2323 0xAC12,0xAC13,0xAC14,0xAC15,0xAC16,0xAC17, 0xAC19,0xAC1A,
2324 0xAC1B },
2326 true,
2327 true,
2328 true,
2329 false,
2330 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2331 { RTL_TEXTENCODING_EUC_KR,
2332 RTL_CONSTASCII_STRINGPARAM(
2333 "\xB0\xA1\xB0\xA2" "\xB0\xA3"
2334 "\xB0\xA4\xB0\xA5\xB0\xA6\xB0\xA7"
2335 "\xB0\xA8\xB0\xA9\xB0\xAA\xB0\xAB\xB0\xAC"
2336 "\xB0\xAD\xB0\xAE\xB0\xAF" "\xB0\xB0\xB0\xB1\xB0\xB2"),
2337 { 0xAC00,0xAC01,0xAC02,0xAC03,0xAC04,0xAC05,0xAC06,0xAC07,0xAC08,
2338 0xAC09,0xAC0A,0xAC0B,0xAC0C,0xAC0D,0xAC0E,0xAC0F,0xAC10,0xAC11,
2339 0xAC12,0xAC13,0xAC14,0xAC15,0xAC16,0xAC17,0xAC18,0xAC19,0xAC1A,
2340 0xAC1B },
2342 true,
2343 false,
2344 true,
2345 false,
2346 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_IGNORE },
2347 { RTL_TEXTENCODING_EUC_KR,
2348 RTL_CONSTASCII_STRINGPARAM(
2349 "\xC9\xA1\xC9\xA2\xC9\xA3\xC9\xFC\xC9\xFD\xC9\xFE"
2350 "\xFE\xA1\xFE\xA2\xFE\xA3\xFE\xFC\xFE\xFD\xFE\xFE"),
2351 { 0xE000,0xE001,0xE002,0xE05B,0xE05C,0xE05D,
2352 0xE05E,0xE05F,0xE060,0xE0B9,0xE0BA,0xE0BB },
2354 true,
2355 true,
2356 true,
2357 false,
2358 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2359 #endif
2360 // Test UTF-8:
2362 { RTL_TEXTENCODING_UTF8,
2363 RTL_CONSTASCII_STRINGPARAM("\x00"),
2364 { 0x0000 },
2366 false,
2367 true,
2368 true,
2369 false,
2370 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2371 { RTL_TEXTENCODING_UTF8,
2372 RTL_CONSTASCII_STRINGPARAM("\xEF\xBB\xBF"),
2373 { 0xFEFF },
2375 false,
2376 true,
2377 true,
2378 false,
2379 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2380 { RTL_TEXTENCODING_UTF8,
2381 RTL_CONSTASCII_STRINGPARAM("\xEF\xBB\xBF\xEF\xBB\xBF"),
2382 { 0xFEFF,0xFEFF },
2384 false,
2385 true,
2386 true,
2387 false,
2388 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2389 { RTL_TEXTENCODING_UTF8,
2390 RTL_CONSTASCII_STRINGPARAM("\xEF\xBB\xBF"),
2391 { 0 },
2393 false,
2394 true,
2395 true,
2396 true,
2397 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2398 { RTL_TEXTENCODING_UTF8,
2399 RTL_CONSTASCII_STRINGPARAM("\xEF\xBB\xBF\xEF\xBB\xBF"),
2400 { 0xFEFF },
2402 false,
2403 true,
2404 true,
2405 true,
2406 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2407 { RTL_TEXTENCODING_UTF8,
2408 RTL_CONSTASCII_STRINGPARAM("\x01\x02\x7E\x7F"),
2409 { 0x0001,0x0002,0x007E,0x007F },
2411 false,
2412 true,
2413 true,
2414 false,
2415 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2416 { RTL_TEXTENCODING_UTF8,
2417 RTL_CONSTASCII_STRINGPARAM("\xEF\xBF\xBF"),
2418 {0xFFFF},
2420 false,
2421 true,
2422 true,
2423 false,
2424 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2426 // Test Java UTF-8:
2428 { RTL_TEXTENCODING_JAVA_UTF8,
2429 RTL_CONSTASCII_STRINGPARAM(
2430 "\xEF\xBB\xBF\xC0\x80\x01\x20\x41\x7F\xED\xA0\x80"
2431 "\xED\xB0\x80"),
2432 { 0xFEFF,0x0000,0x0001,0x0020,0x0041,0x007F,0xD800,0xDC00 },
2434 false,
2435 true,
2436 true,
2437 true,
2438 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2440 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
2441 // Bug #112949#:
2442 { RTL_TEXTENCODING_SHIFT_JIS,
2443 RTL_CONSTASCII_STRINGPARAM("\x81\x63"),
2444 { 0x2026 },
2446 false,
2447 true,
2448 true,
2449 false,
2450 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2451 { RTL_TEXTENCODING_SHIFT_JIS,
2452 RTL_CONSTASCII_STRINGPARAM("\xA0\xFD\xFE\xFF"),
2453 { 0x00A0, 0x00A9, 0x2122, 0x2026 },
2455 false,
2456 true,
2457 false,
2458 false,
2459 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2460 { RTL_TEXTENCODING_SHIFT_JIS,
2461 RTL_CONSTASCII_STRINGPARAM(""),
2462 { 0x00A0, 0x00A9, 0x2122 },
2464 false,
2465 false,
2466 true,
2467 false,
2468 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_IGNORE },
2469 #endif
2470 { RTL_TEXTENCODING_MS_932,
2471 RTL_CONSTASCII_STRINGPARAM("\x81\x63"),
2472 { 0x2026 },
2474 false,
2475 true,
2476 true,
2477 false,
2478 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2479 { RTL_TEXTENCODING_MS_932,
2480 RTL_CONSTASCII_STRINGPARAM("\xA0\xFD\xFE\xFF"),
2481 { 0x00A0, 0x00A9, 0x2122, 0x2026 },
2483 false,
2484 true,
2485 false,
2486 false,
2487 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2488 { RTL_TEXTENCODING_MS_932,
2489 RTL_CONSTASCII_STRINGPARAM(""),
2490 { 0x00A0, 0x00A9, 0x2122 },
2492 false,
2493 false,
2494 true,
2495 false,
2496 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_IGNORE },
2497 { RTL_TEXTENCODING_APPLE_JAPANESE,
2498 RTL_CONSTASCII_STRINGPARAM("\xA0\xFD\xFE\x81\x63"),
2499 { 0x00A0, 0x00A9, 0x2122, 0x2026 },
2501 false,
2502 true,
2503 true,
2504 false,
2505 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2506 { RTL_TEXTENCODING_APPLE_JAPANESE,
2507 RTL_CONSTASCII_STRINGPARAM("\xFF"),
2508 { 0x2026 },
2510 false,
2511 true,
2512 false,
2513 false,
2514 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2516 { RTL_TEXTENCODING_ADOBE_STANDARD,
2517 RTL_CONSTASCII_STRINGPARAM("\x20\x2D\xA4\xB4\xC5"),
2518 { 0x0020, 0x002D, 0x2215, 0x00B7, 0x00AF },
2520 false,
2521 true,
2522 true,
2523 false,
2524 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2525 { RTL_TEXTENCODING_ADOBE_STANDARD,
2526 RTL_CONSTASCII_STRINGPARAM("\x20\x2D\xA4\xB4\xC5"),
2527 { 0x00A0, 0x00AD, 0x2044, 0x2219, 0x02C9 },
2529 false,
2530 false,
2531 true,
2532 false,
2533 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2535 { RTL_TEXTENCODING_ADOBE_SYMBOL,
2536 RTL_CONSTASCII_STRINGPARAM("\x20\x44\x57\x6D\xA4"),
2537 { 0x0020, 0x0394, 0x03A9, 0x03BC, 0x2215 },
2539 false,
2540 true,
2541 true,
2542 false,
2543 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2544 { RTL_TEXTENCODING_ADOBE_SYMBOL,
2545 RTL_CONSTASCII_STRINGPARAM("\x20\x44\x57\x6D\xA4"),
2546 { 0x00A0, 0x2206, 0x2126, 0x00B5, 0x2044 },
2548 false,
2549 false,
2550 true,
2551 false,
2552 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2554 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
2555 // Bug #i62310#:
2556 { RTL_TEXTENCODING_SHIFT_JIS,
2557 RTL_CONSTASCII_STRINGPARAM(
2558 "\xF0\x40\xF0\x7E\xF0\x80\xF0\xFC\xF1\x40\xF9\xFC"),
2559 { 0xE000, 0xE03E, 0xE03F, 0xE0BB, 0xE0BC, 0xE757 },
2561 true,
2562 true,
2563 true,
2564 false,
2565 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2566 #endif
2567 // Bug #i73103#:
2568 { RTL_TEXTENCODING_MS_1258,
2569 RTL_CONSTASCII_STRINGPARAM(
2570 "\xC0\x41\xDE\xE3\xD2\xD4\xEC\xFD\xF2"),
2571 { 0x00C0, 0x0041, 0x0303, 0x0103, 0x0309, 0x00D4, 0x0301, 0x01B0,
2572 0x0323 },
2574 true,
2575 true,
2576 true,
2577 false,
2578 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2579 { RTL_TEXTENCODING_MS_1258,
2580 RTL_CONSTASCII_STRINGPARAM(
2581 "\xC0\x41\xDE\xE3\xD2\xD4\xEC\xFD\xF2"),
2582 { 0x00C0, 0x00C3, 0x1EB3, 0x1ED0, 0x1EF1 },
2584 false,
2585 false,
2586 true,
2587 false,
2588 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2589 #if WITH_LOCALE_ALL || WITH_LOCALE_FOR_SCRIPT_Deva
2590 { RTL_TEXTENCODING_ISCII_DEVANAGARI,
2591 RTL_CONSTASCII_STRINGPARAM(
2592 "\xD7\xE6\x20\xD4\xCF\xE8\xD6\x20"
2593 "\xC8\xD8\xD1\xE1\x20\xB3\xCA\xDC"
2594 "\xCF\xC4\xDA\xD7\x20\xD8\xDB\xA2"
2595 "\xC4\xDE\x20\xB1\xCF\x20\xCC\xDD"
2596 "\xD7\xD1\xCC\xDA\xC6\x20\xC4\xE5"
2597 "\xC6\xE5\xA2\x20\xB3\xE1\x20\xB3"
2598 "\xBD\xE8\xBD\xCF\xC8\xC6\x20\xB3"
2599 "\xE5\x20\xC9\xBD\xB3\xDA\xCF\x20"
2600 "\xB8\xDD\xB3\xE1\x20\xC3\xE1\x20"
2601 "\xEA"),
2602 { 0x0938, 0x094C, 0x0020, 0x0935, 0x0930, 0x094D, 0x0937, 0x0020,
2603 0x092A, 0x0939, 0x0932, 0x0947, 0x0020, 0x0915, 0x092C, 0x0940,
2604 0x0930, 0x0926, 0x093E, 0x0938, 0x0020, 0x0939, 0x093F, 0x0902,
2605 0x0926, 0x0942, 0x0020, 0x0914, 0x0930, 0x0020, 0x092E, 0x0941,
2606 0x0938, 0x0932, 0x092E, 0x093E, 0x0928, 0x0020, 0x0926, 0x094B,
2607 0x0928, 0x094B, 0x0902, 0x0020, 0x0915, 0x0947, 0x0020, 0x0915,
2608 0x091F, 0x094D, 0x091F, 0x0930, 0x092A, 0x0928, 0x0020, 0x0915,
2609 0x094B, 0x0020, 0x092B, 0x091F, 0x0915, 0x093E, 0x0930, 0x0020,
2610 0x091A, 0x0941, 0x0915, 0x0947, 0x0020, 0x0925, 0x0947, 0x0020,
2611 0x0964 },
2613 false,
2614 true,
2615 true,
2616 false,
2617 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2618 { RTL_TEXTENCODING_ISCII_DEVANAGARI,
2619 RTL_CONSTASCII_STRINGPARAM("\xE8\xE8\xE8\xE9\xA1\xE9\xEA\xE9"),
2620 { 0x094D, 0x200C, 0x094D, 0x200D, 0x0950, 0x93D },
2622 false,
2623 true,
2624 true,
2625 false,
2626 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR }
2627 #endif
2629 for (auto const& aDatum : data)
2631 doComplexCharSetTest(aDatum);
2635 void Test::testComplexCut() {
2636 #if WITH_LOCALE_ALL || WITH_LOCALE_ja || WITH_LOCALE_zh
2637 static ComplexCharSetTest const data[]
2639 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
2640 { RTL_TEXTENCODING_EUC_JP,
2641 RTL_CONSTASCII_STRINGPARAM("\xA1"),
2642 { 0 },
2644 true,
2645 true,
2646 false,
2647 false,
2648 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2649 { RTL_TEXTENCODING_EUC_JP,
2650 RTL_CONSTASCII_STRINGPARAM("\x8E"),
2651 { 0 },
2653 true,
2654 true,
2655 false,
2656 false,
2657 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2658 { RTL_TEXTENCODING_EUC_JP,
2659 RTL_CONSTASCII_STRINGPARAM("\x8F"),
2660 { 0 },
2662 true,
2663 true,
2664 false,
2665 false,
2666 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2667 { RTL_TEXTENCODING_EUC_JP,
2668 RTL_CONSTASCII_STRINGPARAM("\x8F\xA1"),
2669 { 0 },
2671 true,
2672 true,
2673 false,
2674 false,
2675 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2676 #endif
2677 #if WITH_LOCALE_ALL || WITH_LOCALE_zh
2678 { RTL_TEXTENCODING_EUC_CN,
2679 RTL_CONSTASCII_STRINGPARAM("\xA1"),
2680 { 0 },
2682 true,
2683 true,
2684 false,
2685 false,
2686 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2687 #endif
2688 /* ,
2689 { RTL_TEXTENCODING_EUC_TW,
2690 RTL_CONSTASCII_STRINGPARAM("\xA1"),
2691 { 0 },
2693 true,
2694 true,
2695 false,
2696 false,
2697 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2698 { RTL_TEXTENCODING_EUC_TW,
2699 RTL_CONSTASCII_STRINGPARAM("\x8E"),
2700 { 0 },
2702 true,
2703 true,
2704 false,
2705 false,
2706 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2707 { RTL_TEXTENCODING_EUC_TW,
2708 RTL_CONSTASCII_STRINGPARAM("\x8E\xA1"),
2709 { 0 },
2711 true,
2712 true,
2713 false,
2714 false,
2715 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR },
2716 { RTL_TEXTENCODING_EUC_TW,
2717 RTL_CONSTASCII_STRINGPARAM("\x8E\xA1\xA1"),
2718 { 0 },
2720 true,
2721 true,
2722 false,
2723 false,
2724 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR } */ };
2725 for (auto const& aDatum : data)
2727 doComplexCharSetCutTest(aDatum);
2729 #endif
2732 void Test::testInvalidUtf7() {
2733 auto const converter = rtl_createTextToUnicodeConverter(RTL_TEXTENCODING_UTF7);
2734 CPPUNIT_ASSERT(converter != nullptr);
2735 sal_Unicode buf[TEST_STRING_SIZE];
2736 sal_uInt32 info;
2737 sal_Size converted;
2738 auto const size = rtl_convertTextToUnicode(
2739 converter, nullptr, RTL_CONSTASCII_STRINGPARAM("\x80"), buf, TEST_STRING_SIZE,
2740 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
2741 | RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT | RTL_TEXTTOUNICODE_FLAGS_FLUSH),
2742 &info, &converted);
2743 CPPUNIT_ASSERT_EQUAL(sal_Size(1), size);
2744 CPPUNIT_ASSERT_EQUAL(u"\uFFFD"_ustr, OUString(buf, sal_Int32(size)));
2745 CPPUNIT_ASSERT_EQUAL(RTL_TEXTTOUNICODE_INFO_INVALID, info);
2746 CPPUNIT_ASSERT_EQUAL(sal_Size(1), converted);
2747 rtl_destroyTextToUnicodeConverter(converter);
2750 void Test::testInvalidUtf8() {
2751 // UTF-8, invalid bytes:
2753 auto const converter = rtl_createTextToUnicodeConverter(
2754 RTL_TEXTENCODING_UTF8);
2755 CPPUNIT_ASSERT(converter != nullptr);
2756 sal_Unicode buf[TEST_STRING_SIZE];
2757 sal_uInt32 info;
2758 sal_Size converted;
2759 auto const size = rtl_convertTextToUnicode(
2760 converter, nullptr, RTL_CONSTASCII_STRINGPARAM("\x80\xBF\xFE\xFF"),
2761 buf, TEST_STRING_SIZE,
2762 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
2763 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
2764 | RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT
2765 | RTL_TEXTTOUNICODE_FLAGS_FLUSH),
2766 &info, &converted);
2767 CPPUNIT_ASSERT_EQUAL(sal_Size(4), size);
2768 CPPUNIT_ASSERT_EQUAL(
2769 u"\uFFFD\uFFFD\uFFFD\uFFFD"_ustr,
2770 OUString(buf, sal_Int32(size)));
2771 CPPUNIT_ASSERT_EQUAL(RTL_TEXTTOUNICODE_INFO_INVALID, info);
2772 CPPUNIT_ASSERT_EQUAL(sal_Size(4), converted);
2773 rtl_destroyTextToUnicodeConverter(converter);
2775 // UTF-8, non-shortest two-byte sequence:
2777 auto const converter = rtl_createTextToUnicodeConverter(
2778 RTL_TEXTENCODING_UTF8);
2779 CPPUNIT_ASSERT(converter != nullptr);
2780 sal_Unicode buf[TEST_STRING_SIZE];
2781 sal_uInt32 info;
2782 sal_Size converted;
2783 auto const size = rtl_convertTextToUnicode(
2784 converter, nullptr, RTL_CONSTASCII_STRINGPARAM("\xC0\x80"),
2785 buf, TEST_STRING_SIZE,
2786 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
2787 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
2788 | RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT
2789 | RTL_TEXTTOUNICODE_FLAGS_FLUSH),
2790 &info, &converted);
2791 CPPUNIT_ASSERT_EQUAL(sal_Size(1), size);
2792 CPPUNIT_ASSERT_EQUAL(
2793 u"\uFFFD"_ustr, OUString(buf, sal_Int32(size)));
2794 CPPUNIT_ASSERT_EQUAL(RTL_TEXTTOUNICODE_INFO_INVALID, info);
2795 CPPUNIT_ASSERT_EQUAL(sal_Size(2), converted);
2796 rtl_destroyTextToUnicodeConverter(converter);
2798 // UTF-8, cut two-byte sequence:
2800 auto const converter = rtl_createTextToUnicodeConverter(
2801 RTL_TEXTENCODING_UTF8);
2802 CPPUNIT_ASSERT(converter != nullptr);
2803 sal_Unicode buf[TEST_STRING_SIZE];
2804 sal_uInt32 info;
2805 sal_Size converted;
2806 auto const size = rtl_convertTextToUnicode(
2807 converter, nullptr, RTL_CONSTASCII_STRINGPARAM("\xC0"), buf,
2808 TEST_STRING_SIZE,
2809 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
2810 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
2811 | RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR),
2812 &info, &converted);
2813 CPPUNIT_ASSERT_EQUAL(sal_Size(0), size);
2814 CPPUNIT_ASSERT_EQUAL(RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOSMALL, info);
2815 CPPUNIT_ASSERT(converted <= 1);
2816 rtl_destroyTextToUnicodeConverter(converter);
2818 // UTF-8, non-shortest three-byte sequence:
2820 auto const converter = rtl_createTextToUnicodeConverter(
2821 RTL_TEXTENCODING_UTF8);
2822 CPPUNIT_ASSERT(converter != nullptr);
2823 sal_Unicode buf[TEST_STRING_SIZE];
2824 sal_uInt32 info;
2825 sal_Size converted;
2826 auto const size = rtl_convertTextToUnicode(
2827 converter, nullptr, RTL_CONSTASCII_STRINGPARAM("\xE0\x9F\xBF"),
2828 buf, TEST_STRING_SIZE,
2829 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
2830 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
2831 | RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT
2832 | RTL_TEXTTOUNICODE_FLAGS_FLUSH),
2833 &info, &converted);
2834 CPPUNIT_ASSERT_EQUAL(sal_Size(1), size);
2835 CPPUNIT_ASSERT_EQUAL(
2836 u"\uFFFD"_ustr, OUString(buf, sal_Int32(size)));
2837 CPPUNIT_ASSERT_EQUAL(RTL_TEXTTOUNICODE_INFO_INVALID, info);
2838 CPPUNIT_ASSERT_EQUAL(sal_Size(3), converted);
2839 rtl_destroyTextToUnicodeConverter(converter);
2841 // UTF-8, cut three-byte sequence:
2843 auto const converter = rtl_createTextToUnicodeConverter(
2844 RTL_TEXTENCODING_UTF8);
2845 CPPUNIT_ASSERT(converter != nullptr);
2846 sal_Unicode buf[TEST_STRING_SIZE];
2847 sal_uInt32 info;
2848 sal_Size converted;
2849 auto const size = rtl_convertTextToUnicode(
2850 converter, nullptr, RTL_CONSTASCII_STRINGPARAM("\xE0\x80"), buf,
2851 TEST_STRING_SIZE,
2852 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
2853 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
2854 | RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR),
2855 &info, &converted);
2856 CPPUNIT_ASSERT_EQUAL(sal_Size(0), size);
2857 CPPUNIT_ASSERT_EQUAL(RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOSMALL, info);
2858 CPPUNIT_ASSERT(converted <= 2);
2859 rtl_destroyTextToUnicodeConverter(converter);
2861 // UTF-8, cut three-byte sequence followed by more:
2863 auto const converter = rtl_createTextToUnicodeConverter(
2864 RTL_TEXTENCODING_UTF8);
2865 CPPUNIT_ASSERT(converter != nullptr);
2866 sal_Unicode buf[TEST_STRING_SIZE];
2867 sal_uInt32 info;
2868 sal_Size converted;
2869 auto const size = rtl_convertTextToUnicode(
2870 converter, nullptr, RTL_CONSTASCII_STRINGPARAM("\xE0\x80."), buf,
2871 TEST_STRING_SIZE,
2872 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
2873 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
2874 | RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT
2875 | RTL_TEXTTOUNICODE_FLAGS_FLUSH),
2876 &info, &converted);
2877 CPPUNIT_ASSERT_EQUAL(sal_Size(2), size);
2878 CPPUNIT_ASSERT_EQUAL(
2879 u"\uFFFD."_ustr, OUString(buf, sal_Int32(size)));
2880 CPPUNIT_ASSERT_EQUAL(RTL_TEXTTOUNICODE_INFO_INVALID, info);
2881 CPPUNIT_ASSERT_EQUAL(sal_Size(3), converted);
2882 rtl_destroyTextToUnicodeConverter(converter);
2884 // UTF-8, surrogates:
2886 auto const converter = rtl_createTextToUnicodeConverter(
2887 RTL_TEXTENCODING_UTF8);
2888 CPPUNIT_ASSERT(converter != nullptr);
2889 sal_Unicode buf[TEST_STRING_SIZE];
2890 sal_uInt32 info;
2891 sal_Size converted;
2892 auto const size = rtl_convertTextToUnicode(
2893 converter, nullptr,
2894 RTL_CONSTASCII_STRINGPARAM("\xED\xA0\x80\xED\xB0\x80"), buf,
2895 TEST_STRING_SIZE,
2896 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
2897 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
2898 | RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT
2899 | RTL_TEXTTOUNICODE_FLAGS_FLUSH),
2900 &info, &converted);
2901 CPPUNIT_ASSERT_EQUAL(sal_Size(2), size);
2902 CPPUNIT_ASSERT_EQUAL(
2903 u"\uFFFD\uFFFD"_ustr, OUString(buf, sal_Int32(size)));
2904 CPPUNIT_ASSERT_EQUAL(RTL_TEXTTOUNICODE_INFO_INVALID, info);
2905 CPPUNIT_ASSERT_EQUAL(sal_Size(6), converted);
2906 rtl_destroyTextToUnicodeConverter(converter);
2908 // UTF-8, non-shortest four-byte sequence:
2910 auto const converter = rtl_createTextToUnicodeConverter(
2911 RTL_TEXTENCODING_UTF8);
2912 CPPUNIT_ASSERT(converter != nullptr);
2913 sal_Unicode buf[TEST_STRING_SIZE];
2914 sal_uInt32 info;
2915 sal_Size converted;
2916 auto const size = rtl_convertTextToUnicode(
2917 converter, nullptr, RTL_CONSTASCII_STRINGPARAM("\xF0\x8F\xBF\xBF"),
2918 buf, TEST_STRING_SIZE,
2919 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
2920 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
2921 | RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT
2922 | RTL_TEXTTOUNICODE_FLAGS_FLUSH),
2923 &info, &converted);
2924 CPPUNIT_ASSERT_EQUAL(sal_Size(1), size);
2925 CPPUNIT_ASSERT_EQUAL(
2926 u"\uFFFD"_ustr, OUString(buf, sal_Int32(size)));
2927 CPPUNIT_ASSERT_EQUAL(RTL_TEXTTOUNICODE_INFO_INVALID, info);
2928 CPPUNIT_ASSERT_EQUAL(sal_Size(4), converted);
2929 rtl_destroyTextToUnicodeConverter(converter);
2931 // UTF-8, too-large four-byte sequence:
2933 auto const converter = rtl_createTextToUnicodeConverter(
2934 RTL_TEXTENCODING_UTF8);
2935 CPPUNIT_ASSERT(converter != nullptr);
2936 sal_Unicode buf[TEST_STRING_SIZE];
2937 sal_uInt32 info;
2938 sal_Size converted;
2939 auto const size = rtl_convertTextToUnicode(
2940 converter, nullptr, RTL_CONSTASCII_STRINGPARAM("\xF4\x90\x80\x80"),
2941 buf, TEST_STRING_SIZE,
2942 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
2943 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
2944 | RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT
2945 | RTL_TEXTTOUNICODE_FLAGS_FLUSH),
2946 &info, &converted);
2947 CPPUNIT_ASSERT_EQUAL(sal_Size(1), size);
2948 CPPUNIT_ASSERT_EQUAL(
2949 u"\uFFFD"_ustr, OUString(buf, sal_Int32(size)));
2950 CPPUNIT_ASSERT_EQUAL(RTL_TEXTTOUNICODE_INFO_INVALID, info);
2951 CPPUNIT_ASSERT_EQUAL(sal_Size(4), converted);
2952 rtl_destroyTextToUnicodeConverter(converter);
2954 // UTF-8, five-byte sequence:
2956 auto const converter = rtl_createTextToUnicodeConverter(
2957 RTL_TEXTENCODING_UTF8);
2958 CPPUNIT_ASSERT(converter != nullptr);
2959 sal_Unicode buf[TEST_STRING_SIZE];
2960 sal_uInt32 info;
2961 sal_Size converted;
2962 auto const size = rtl_convertTextToUnicode(
2963 converter, nullptr,
2964 RTL_CONSTASCII_STRINGPARAM("\xFB\xBF\xBF\xBF\xBF"),
2965 buf, TEST_STRING_SIZE,
2966 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
2967 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
2968 | RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT
2969 | RTL_TEXTTOUNICODE_FLAGS_FLUSH),
2970 &info, &converted);
2971 CPPUNIT_ASSERT_EQUAL(sal_Size(1), size);
2972 CPPUNIT_ASSERT_EQUAL(
2973 u"\uFFFD"_ustr, OUString(buf, sal_Int32(size)));
2974 CPPUNIT_ASSERT_EQUAL(RTL_TEXTTOUNICODE_INFO_INVALID, info);
2975 CPPUNIT_ASSERT_EQUAL(sal_Size(5), converted);
2976 rtl_destroyTextToUnicodeConverter(converter);
2978 // UTF-8, six-byte sequence:
2980 auto const converter = rtl_createTextToUnicodeConverter(
2981 RTL_TEXTENCODING_UTF8);
2982 CPPUNIT_ASSERT(converter != nullptr);
2983 sal_Unicode buf[TEST_STRING_SIZE];
2984 sal_uInt32 info;
2985 sal_Size converted;
2986 auto const size = rtl_convertTextToUnicode(
2987 converter, nullptr,
2988 RTL_CONSTASCII_STRINGPARAM("\xFD\xBF\xBF\xBF\xBF\xBF"),
2989 buf, TEST_STRING_SIZE,
2990 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
2991 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
2992 | RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT
2993 | RTL_TEXTTOUNICODE_FLAGS_FLUSH),
2994 &info, &converted);
2995 CPPUNIT_ASSERT_EQUAL(sal_Size(1), size);
2996 CPPUNIT_ASSERT_EQUAL(
2997 u"\uFFFD"_ustr, OUString(buf, sal_Int32(size)));
2998 CPPUNIT_ASSERT_EQUAL(RTL_TEXTTOUNICODE_INFO_INVALID, info);
2999 CPPUNIT_ASSERT_EQUAL(sal_Size(6), converted);
3000 rtl_destroyTextToUnicodeConverter(converter);
3002 // Java UTF-8, U+0000:
3004 auto const converter = rtl_createTextToUnicodeConverter(
3005 RTL_TEXTENCODING_JAVA_UTF8);
3006 CPPUNIT_ASSERT(converter != nullptr);
3007 sal_Unicode buf[TEST_STRING_SIZE];
3008 sal_uInt32 info;
3009 sal_Size converted;
3010 auto const size = rtl_convertTextToUnicode(
3011 converter, nullptr, RTL_CONSTASCII_STRINGPARAM("\0"), buf,
3012 TEST_STRING_SIZE,
3013 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
3014 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
3015 | RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT
3016 | RTL_TEXTTOUNICODE_FLAGS_FLUSH),
3017 &info, &converted);
3018 CPPUNIT_ASSERT_EQUAL(sal_Size(1), size);
3019 CPPUNIT_ASSERT_EQUAL(
3020 u"\uFFFD"_ustr, OUString(buf, sal_Int32(size)));
3021 CPPUNIT_ASSERT_EQUAL(RTL_TEXTTOUNICODE_INFO_INVALID, info);
3022 CPPUNIT_ASSERT_EQUAL(sal_Size(1), converted);
3023 rtl_destroyTextToUnicodeConverter(converter);
3025 // Java UTF-8, U+10000:
3027 auto const converter = rtl_createTextToUnicodeConverter(
3028 RTL_TEXTENCODING_JAVA_UTF8);
3029 CPPUNIT_ASSERT(converter != nullptr);
3030 static constexpr OString input(u8"\U00010000"_ostr);
3031 sal_Unicode buf[TEST_STRING_SIZE];
3032 sal_uInt32 info;
3033 sal_Size converted;
3034 auto const size = rtl_convertTextToUnicode(
3035 converter, nullptr, input.getStr(), input.getLength(), buf,
3036 TEST_STRING_SIZE,
3037 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
3038 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
3039 | RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT
3040 | RTL_TEXTTOUNICODE_FLAGS_FLUSH),
3041 &info, &converted);
3042 CPPUNIT_ASSERT_EQUAL(sal_Size(1), size);
3043 CPPUNIT_ASSERT_EQUAL(
3044 u"\uFFFD"_ustr, OUString(buf, sal_Int32(size)));
3045 CPPUNIT_ASSERT_EQUAL(RTL_TEXTTOUNICODE_INFO_INVALID, info);
3046 CPPUNIT_ASSERT_EQUAL(sal_Size(4), converted);
3047 rtl_destroyTextToUnicodeConverter(converter);
3051 void Test::testInvalidUnicode() {
3052 auto const converter = rtl_createUnicodeToTextConverter(RTL_TEXTENCODING_UTF8);
3053 CPPUNIT_ASSERT(converter != nullptr);
3054 sal_Unicode const input[] = {0xDC00}; // lone low surrogate
3055 char buf[TEST_STRING_SIZE];
3056 sal_uInt32 info;
3057 sal_Size converted;
3058 auto const size = rtl_convertUnicodeToText(
3059 converter, nullptr, input, SAL_N_ELEMENTS(input), buf, TEST_STRING_SIZE,
3060 (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR
3061 | RTL_UNICODETOTEXT_FLAGS_FLUSH),
3062 &info, &converted);
3063 CPPUNIT_ASSERT_EQUAL(sal_Size(0), size);
3064 CPPUNIT_ASSERT_EQUAL(RTL_UNICODETOTEXT_INFO_ERROR | RTL_UNICODETOTEXT_INFO_INVALID, info);
3065 CPPUNIT_ASSERT_EQUAL(sal_Size(1), converted);
3066 rtl_destroyTextToUnicodeConverter(converter);
3069 void Test::testSRCBUFFERTOSMALL() {
3070 rtl_TextToUnicodeConverter cv = rtl_createTextToUnicodeConverter(
3071 RTL_TEXTENCODING_EUC_JP);
3072 CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeConverter(EUC-JP) failed",
3073 cv != nullptr);
3074 rtl_TextToUnicodeContext cx = rtl_createTextToUnicodeContext(cv);
3075 CPPUNIT_ASSERT_MESSAGE("rtl_createTextToUnicodeContext failed", cx != nullptr);
3076 char src = '\xA1';
3077 sal_Unicode dst[10];
3078 sal_uInt32 info;
3079 sal_Size cvt;
3080 CPPUNIT_ASSERT_EQUAL(
3081 sal_Size(0),
3082 rtl_convertTextToUnicode(
3083 cv, cx, &src, 1, dst, SAL_N_ELEMENTS(dst),
3084 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR |
3085 RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR |
3086 RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR),
3087 &info, &cvt));
3088 CPPUNIT_ASSERT_EQUAL(RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOOSMALL, info);
3089 CPPUNIT_ASSERT(cvt <= 1);
3090 rtl_destroyTextToUnicodeContext(cv, cx);
3091 rtl_destroyTextToUnicodeConverter(cv);
3094 void Test::testMime() {
3095 struct Data {
3096 char const * mime;
3097 rtl_TextEncoding encoding;
3098 bool reverse;
3100 static Data const data[] = {
3101 { "GBK", RTL_TEXTENCODING_GBK, false },
3102 { "CP936", RTL_TEXTENCODING_GBK, false },
3103 { "MS936", RTL_TEXTENCODING_GBK, false },
3104 { "windows-936", RTL_TEXTENCODING_GBK, false },
3106 { "GB18030", RTL_TEXTENCODING_GB_18030, false },
3108 { "TIS-620", RTL_TEXTENCODING_TIS_620, true },
3109 { "ISO-8859-11", RTL_TEXTENCODING_TIS_620, false }, // not registered
3111 { "CP874", RTL_TEXTENCODING_MS_874, false }, // not registered
3112 { "MS874", RTL_TEXTENCODING_MS_874, false }, // not registered
3113 { "windows-874", RTL_TEXTENCODING_MS_874, true }, // not registered
3115 { "ISO_8859-8:1988", RTL_TEXTENCODING_ISO_8859_8, false },
3116 { "iso-ir-138", RTL_TEXTENCODING_ISO_8859_8, false },
3117 { "ISO_8859-8", RTL_TEXTENCODING_ISO_8859_8, false },
3118 { "ISO-8859-8", RTL_TEXTENCODING_ISO_8859_8, true },
3119 { "hebrew", RTL_TEXTENCODING_ISO_8859_8, false },
3120 { "csISOLatinHebrew", RTL_TEXTENCODING_ISO_8859_8, false },
3122 { "windows-1255", RTL_TEXTENCODING_MS_1255, true },
3124 { "IBM862", RTL_TEXTENCODING_IBM_862, true },
3125 { "cp862", RTL_TEXTENCODING_IBM_862, false },
3126 { "862", RTL_TEXTENCODING_IBM_862, false },
3127 { "csPC862LatinHebrew", RTL_TEXTENCODING_IBM_862, false },
3129 { "ISO_8859-6:1987", RTL_TEXTENCODING_ISO_8859_6, false },
3130 { "iso-ir-127", RTL_TEXTENCODING_ISO_8859_6, false },
3131 { "ISO_8859-6", RTL_TEXTENCODING_ISO_8859_6, false },
3132 { "ISO-8859-6", RTL_TEXTENCODING_ISO_8859_6, true },
3133 { "ECMA-114", RTL_TEXTENCODING_ISO_8859_6, false },
3134 { "ASMO-708", RTL_TEXTENCODING_ISO_8859_6, false },
3135 { "arabic", RTL_TEXTENCODING_ISO_8859_6, false },
3136 { "csISOLatinArabic", RTL_TEXTENCODING_ISO_8859_6, false },
3138 { "windows-1256", RTL_TEXTENCODING_MS_1256, true },
3140 { "IBM864", RTL_TEXTENCODING_IBM_864, true },
3141 { "cp864", RTL_TEXTENCODING_IBM_864, false },
3142 { "csIBM864", RTL_TEXTENCODING_IBM_864, false },
3144 { "KOI8-R", RTL_TEXTENCODING_KOI8_R, false },
3145 { "csKOI8R", RTL_TEXTENCODING_KOI8_R, false },
3146 { "koi8-r", RTL_TEXTENCODING_KOI8_R, true },
3148 { "KOI8-U", RTL_TEXTENCODING_KOI8_U, true },
3150 { "IBM860", RTL_TEXTENCODING_IBM_860, true },
3151 { "cp860", RTL_TEXTENCODING_IBM_860, false },
3152 { "860", RTL_TEXTENCODING_IBM_860, false },
3153 { "csIBM860", RTL_TEXTENCODING_IBM_860, false },
3155 { "IBM861", RTL_TEXTENCODING_IBM_861, true },
3156 { "cp861", RTL_TEXTENCODING_IBM_861, false },
3157 { "861", RTL_TEXTENCODING_IBM_861, false },
3158 { "cp-is", RTL_TEXTENCODING_IBM_861, false },
3159 { "csIBM861", RTL_TEXTENCODING_IBM_861, false },
3161 { "IBM863", RTL_TEXTENCODING_IBM_863, true },
3162 { "cp863", RTL_TEXTENCODING_IBM_863, false },
3163 { "863", RTL_TEXTENCODING_IBM_863, false },
3164 { "csIBM863", RTL_TEXTENCODING_IBM_863, false },
3166 { "IBM865", RTL_TEXTENCODING_IBM_865, true },
3167 { "cp865", RTL_TEXTENCODING_IBM_865, false },
3168 { "865", RTL_TEXTENCODING_IBM_865, false },
3169 { "csIBM865", RTL_TEXTENCODING_IBM_865, false },
3171 { "Latin-9", RTL_TEXTENCODING_ISO_8859_15, false },
3173 { "KS_C_5601-1987", RTL_TEXTENCODING_MS_949, false },
3174 { "iso-ir-149", RTL_TEXTENCODING_MS_949, false },
3175 { "KS_C_5601-1989", RTL_TEXTENCODING_MS_949, false },
3176 { "KSC_5601", RTL_TEXTENCODING_MS_949, false },
3177 { "korean", RTL_TEXTENCODING_MS_949, false },
3178 { "csKSC56011987", RTL_TEXTENCODING_MS_949, false },
3179 { nullptr, RTL_TEXTENCODING_MS_949, true },
3181 { "Adobe-Standard-Encoding", RTL_TEXTENCODING_ADOBE_STANDARD, false },
3182 { "csAdobeStandardEncoding", RTL_TEXTENCODING_ADOBE_STANDARD, false },
3183 { "Adobe-Symbol-Encoding", RTL_TEXTENCODING_ADOBE_SYMBOL, false },
3184 { "csHPPSMath", RTL_TEXTENCODING_ADOBE_SYMBOL, false },
3186 { "PTCP154", RTL_TEXTENCODING_PT154, true },
3187 { "csPTCP154", RTL_TEXTENCODING_PT154, false },
3188 { "PT154", RTL_TEXTENCODING_PT154, false },
3189 { "CP154", RTL_TEXTENCODING_PT154, false },
3190 { "Cyrillic-Asian", RTL_TEXTENCODING_PT154, false }
3192 for (auto const[pMime,nEncoding,bReverse] : data)
3194 if (pMime == nullptr)
3196 OSL_ASSERT(bReverse);
3197 CPPUNIT_ASSERT_EQUAL(static_cast< char const * >(nullptr),
3198 rtl_getMimeCharsetFromTextEncoding(nEncoding));
3200 else
3202 CPPUNIT_ASSERT_EQUAL(nEncoding, rtl_getTextEncodingFromMimeCharset(pMime));
3203 if (bReverse)
3205 CPPUNIT_ASSERT_EQUAL(OString(pMime),
3206 OString( rtl_getMimeCharsetFromTextEncoding(nEncoding)));
3212 void Test::testWindows() {
3213 struct Data {
3214 sal_uInt32 codePage;
3215 rtl_TextEncoding encoding;
3216 bool reverse;
3218 static Data const data[] = {
3219 { 42, RTL_TEXTENCODING_SYMBOL, true },
3220 { 437, RTL_TEXTENCODING_IBM_437, true },
3221 { 708, RTL_TEXTENCODING_ISO_8859_6, false },
3222 { 737, RTL_TEXTENCODING_IBM_737, true },
3223 { 775, RTL_TEXTENCODING_IBM_775, true },
3224 { 850, RTL_TEXTENCODING_IBM_850, true },
3225 { 852, RTL_TEXTENCODING_IBM_852, true },
3226 { 855, RTL_TEXTENCODING_IBM_855, true },
3227 { 857, RTL_TEXTENCODING_IBM_857, true },
3228 { 860, RTL_TEXTENCODING_IBM_860, true },
3229 { 861, RTL_TEXTENCODING_IBM_861, true },
3230 { 862, RTL_TEXTENCODING_IBM_862, true },
3231 { 863, RTL_TEXTENCODING_IBM_863, true },
3232 { 864, RTL_TEXTENCODING_IBM_864, true },
3233 { 865, RTL_TEXTENCODING_IBM_865, true },
3234 { 866, RTL_TEXTENCODING_IBM_866, true },
3235 { 869, RTL_TEXTENCODING_IBM_869, true },
3236 { 874, RTL_TEXTENCODING_MS_874, true },
3237 { 932, RTL_TEXTENCODING_MS_932, true },
3238 { 936, RTL_TEXTENCODING_MS_936, true },
3239 { 949, RTL_TEXTENCODING_MS_949, true },
3240 { 950, RTL_TEXTENCODING_MS_950, true },
3241 { 1250, RTL_TEXTENCODING_MS_1250, true },
3242 { 1251, RTL_TEXTENCODING_MS_1251, true },
3243 { 1252, RTL_TEXTENCODING_MS_1252, true },
3244 { 1253, RTL_TEXTENCODING_MS_1253, true },
3245 { 1254, RTL_TEXTENCODING_MS_1254, true },
3246 { 1255, RTL_TEXTENCODING_MS_1255, true },
3247 { 1256, RTL_TEXTENCODING_MS_1256, true },
3248 { 1257, RTL_TEXTENCODING_MS_1257, true },
3249 { 1258, RTL_TEXTENCODING_MS_1258, true },
3250 { 1361, RTL_TEXTENCODING_MS_1361, true },
3251 { 10000, RTL_TEXTENCODING_APPLE_ROMAN, true },
3252 { 10001, RTL_TEXTENCODING_APPLE_JAPANESE, true },
3253 { 10002, RTL_TEXTENCODING_APPLE_CHINTRAD, true },
3254 { 10003, RTL_TEXTENCODING_APPLE_KOREAN, true },
3255 { 10004, RTL_TEXTENCODING_APPLE_ARABIC, true },
3256 { 10005, RTL_TEXTENCODING_APPLE_HEBREW, true },
3257 { 10006, RTL_TEXTENCODING_APPLE_GREEK, true },
3258 { 10007, RTL_TEXTENCODING_APPLE_CYRILLIC, true },
3259 { 10008, RTL_TEXTENCODING_APPLE_CHINSIMP, true },
3260 { 10010, RTL_TEXTENCODING_APPLE_ROMANIAN, true },
3261 { 10017, RTL_TEXTENCODING_APPLE_UKRAINIAN, true },
3262 { 10029, RTL_TEXTENCODING_APPLE_CENTEURO, true },
3263 { 10079, RTL_TEXTENCODING_APPLE_ICELAND, true },
3264 { 10081, RTL_TEXTENCODING_APPLE_TURKISH, true },
3265 { 10082, RTL_TEXTENCODING_APPLE_CROATIAN, true },
3266 { 20127, RTL_TEXTENCODING_ASCII_US, true },
3267 { 20866, RTL_TEXTENCODING_KOI8_R, true },
3268 { 21866, RTL_TEXTENCODING_KOI8_U, true },
3269 { 28591, RTL_TEXTENCODING_ISO_8859_1, true },
3270 { 28592, RTL_TEXTENCODING_ISO_8859_2, true },
3271 { 28593, RTL_TEXTENCODING_ISO_8859_3, true },
3272 { 28594, RTL_TEXTENCODING_ISO_8859_4, true },
3273 { 28595, RTL_TEXTENCODING_ISO_8859_5, true },
3274 { 28596, RTL_TEXTENCODING_ISO_8859_6, true },
3275 { 28597, RTL_TEXTENCODING_ISO_8859_7, true },
3276 { 28598, RTL_TEXTENCODING_ISO_8859_8, true },
3277 { 28599, RTL_TEXTENCODING_ISO_8859_9, true },
3278 { 28605, RTL_TEXTENCODING_ISO_8859_15, true },
3279 { 50220, RTL_TEXTENCODING_ISO_2022_JP, true },
3280 { 50225, RTL_TEXTENCODING_ISO_2022_KR, true },
3281 { 51932, RTL_TEXTENCODING_EUC_JP, true },
3282 { 51936, RTL_TEXTENCODING_EUC_CN, true },
3283 { 51949, RTL_TEXTENCODING_EUC_KR, true },
3284 { 65000, RTL_TEXTENCODING_UTF7, true },
3285 { 65001, RTL_TEXTENCODING_UTF8, true },
3286 { 1200, RTL_TEXTENCODING_DONTKNOW, false }, // UTF_16LE
3287 { 1201, RTL_TEXTENCODING_DONTKNOW, false }, // UTF_16LE
3288 { 0, RTL_TEXTENCODING_DONTKNOW, true },
3289 { 0, RTL_TEXTENCODING_UCS4, true },
3290 { 0, RTL_TEXTENCODING_UCS2, true },
3291 { 57002, RTL_TEXTENCODING_ISCII_DEVANAGARI, true }
3293 for (auto const[nCodePage,nEncoding,bReverse] : data)
3295 OSL_ASSERT(nCodePage != 0 || bReverse);
3296 if (nCodePage != 0)
3298 CPPUNIT_ASSERT_EQUAL( nEncoding, rtl_getTextEncodingFromWindowsCodePage(nCodePage));
3300 if (bReverse)
3302 CPPUNIT_ASSERT_EQUAL( nCodePage, rtl_getWindowsCodePageFromTextEncoding(nEncoding));
3307 void Test::testInfo() {
3308 struct Data {
3309 rtl_TextEncoding encoding;
3310 sal_uInt32 flag;
3311 bool value;
3313 static Data const data[] = {
3314 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
3315 { RTL_TEXTENCODING_APPLE_JAPANESE, RTL_TEXTENCODING_INFO_ASCII, false },
3316 { RTL_TEXTENCODING_EUC_JP, RTL_TEXTENCODING_INFO_ASCII, true },
3317 { RTL_TEXTENCODING_ISO_2022_JP, RTL_TEXTENCODING_INFO_CONTEXT, true },
3318 { RTL_TEXTENCODING_ISO_2022_JP, RTL_TEXTENCODING_INFO_ASCII, false },
3319 { RTL_TEXTENCODING_SHIFT_JIS, RTL_TEXTENCODING_INFO_ASCII, false },
3320 #endif
3321 #if WITH_LOCALE_ALL || WITH_LOCALE_ko
3322 { RTL_TEXTENCODING_APPLE_KOREAN, RTL_TEXTENCODING_INFO_ASCII, false },
3323 { RTL_TEXTENCODING_EUC_KR, RTL_TEXTENCODING_INFO_ASCII, true },
3324 { RTL_TEXTENCODING_ISO_2022_KR, RTL_TEXTENCODING_INFO_CONTEXT, true },
3325 { RTL_TEXTENCODING_ISO_2022_KR, RTL_TEXTENCODING_INFO_ASCII, false },
3326 #endif
3327 #if WITH_LOCALE_ALL || WITH_LOCALE_zh
3328 { RTL_TEXTENCODING_APPLE_CHINTRAD, RTL_TEXTENCODING_INFO_ASCII, false },
3329 { RTL_TEXTENCODING_BIG5, RTL_TEXTENCODING_INFO_ASCII, false },
3330 { RTL_TEXTENCODING_BIG5_HKSCS, RTL_TEXTENCODING_INFO_ASCII, false },
3331 { RTL_TEXTENCODING_EUC_CN, RTL_TEXTENCODING_INFO_ASCII, true },
3332 { RTL_TEXTENCODING_EUC_TW, RTL_TEXTENCODING_INFO_ASCII, true },
3333 { RTL_TEXTENCODING_GBK, RTL_TEXTENCODING_INFO_ASCII, false },
3334 { RTL_TEXTENCODING_GB_18030, RTL_TEXTENCODING_INFO_ASCII, false },
3335 { RTL_TEXTENCODING_GB_18030, RTL_TEXTENCODING_INFO_UNICODE, true },
3336 { RTL_TEXTENCODING_ISO_2022_CN, RTL_TEXTENCODING_INFO_CONTEXT, true },
3337 { RTL_TEXTENCODING_ISO_2022_CN, RTL_TEXTENCODING_INFO_ASCII, false },
3338 #endif
3339 #if WITH_LOCALE_ALL || WITH_LOCALE_FOR_SCRIPT_Deva
3340 { RTL_TEXTENCODING_ISCII_DEVANAGARI, RTL_TEXTENCODING_INFO_ASCII, true },
3341 { RTL_TEXTENCODING_ISCII_DEVANAGARI, RTL_TEXTENCODING_INFO_MIME, false },
3342 #endif
3343 { RTL_TEXTENCODING_MS_1361, RTL_TEXTENCODING_INFO_ASCII, false },
3344 { RTL_TEXTENCODING_MS_874, RTL_TEXTENCODING_INFO_ASCII, true },
3345 { RTL_TEXTENCODING_MS_932, RTL_TEXTENCODING_INFO_ASCII, false },
3346 { RTL_TEXTENCODING_MS_936, RTL_TEXTENCODING_INFO_ASCII, false },
3347 { RTL_TEXTENCODING_MS_949, RTL_TEXTENCODING_INFO_ASCII, false },
3348 { RTL_TEXTENCODING_MS_950, RTL_TEXTENCODING_INFO_ASCII, false },
3349 { RTL_TEXTENCODING_KOI8_R, RTL_TEXTENCODING_INFO_ASCII, true },
3350 { RTL_TEXTENCODING_KOI8_R, RTL_TEXTENCODING_INFO_MIME, true },
3351 { RTL_TEXTENCODING_KOI8_U, RTL_TEXTENCODING_INFO_ASCII, true },
3352 { RTL_TEXTENCODING_KOI8_U, RTL_TEXTENCODING_INFO_MIME, true },
3353 { RTL_TEXTENCODING_IBM_860, RTL_TEXTENCODING_INFO_MIME, true },
3354 { RTL_TEXTENCODING_IBM_861, RTL_TEXTENCODING_INFO_MIME, true },
3355 { RTL_TEXTENCODING_IBM_863, RTL_TEXTENCODING_INFO_MIME, true },
3356 { RTL_TEXTENCODING_IBM_865, RTL_TEXTENCODING_INFO_MIME, true },
3357 { RTL_TEXTENCODING_ADOBE_STANDARD, RTL_TEXTENCODING_INFO_ASCII, false },
3358 { RTL_TEXTENCODING_ADOBE_STANDARD, RTL_TEXTENCODING_INFO_MIME, true },
3359 { RTL_TEXTENCODING_ADOBE_STANDARD, RTL_TEXTENCODING_INFO_SYMBOL, false },
3360 { RTL_TEXTENCODING_ADOBE_SYMBOL, RTL_TEXTENCODING_INFO_ASCII, false },
3361 { RTL_TEXTENCODING_ADOBE_SYMBOL, RTL_TEXTENCODING_INFO_MIME, true },
3362 { RTL_TEXTENCODING_ADOBE_SYMBOL, RTL_TEXTENCODING_INFO_SYMBOL, true },
3363 { RTL_TEXTENCODING_PT154, RTL_TEXTENCODING_INFO_ASCII, true },
3364 { RTL_TEXTENCODING_PT154, RTL_TEXTENCODING_INFO_MIME, true }
3366 for (auto const[nEncoding, nFlag, bValue] : data)
3368 rtl_TextEncodingInfo info;
3369 info.StructSize = sizeof info;
3370 CPPUNIT_ASSERT(rtl_getTextEncodingInfo(nEncoding, &info));
3371 CPPUNIT_ASSERT_EQUAL(bValue, ((info.Flags & nFlag) != 0));
3375 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
3379 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */