1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rtl_tencinfo.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 // MARKER(update_precomp.py): autogen include statement, do not remove
33 #include "precompiled_sal.hxx"
36 #include <osl/thread.h>
37 #include <rtl/tencinfo.h>
39 #include <cppunit/simpleheader.hxx>
41 // -----------------------------------------------------------------------------
43 namespace rtl_tencinfo
45 class getBestMime
: public CppUnit::TestFixture
52 void check( const sal_Char
* _pRTL_TEXTENCODING
, rtl_TextEncoding _aCurrentEncode
)
54 const sal_Char
*pCharSet
= rtl_getBestMimeCharsetFromTextEncoding( _aCurrentEncode
);
57 t_print("rtl_getBestMimeCharsetFromTextEncoding(%s) (%d) doesn't seem to exist.\n\n", _pRTL_TEXTENCODING
, _aCurrentEncode
);
61 t_print(T_VERBOSE
, "'%s' is charset: '%s'\n", _pRTL_TEXTENCODING
, pCharSet
);
63 rtl_TextEncoding eTextEnc
= rtl_getTextEncodingFromMimeCharset( pCharSet
);
64 if (_aCurrentEncode
!= eTextEnc
&&
65 eTextEnc
!= RTL_TEXTENCODING_DONTKNOW
)
67 t_print("rtl_getBestMimeCharsetFromTextEncoding(%s) is charset: %s\n", _pRTL_TEXTENCODING
, pCharSet
);
68 t_print("rtl_getTextEncodingFromMimeCharset() differ: %s %d -> %d\n\n", _pRTL_TEXTENCODING
, _aCurrentEncode
, eTextEnc
);
70 // rtl::OString sError = "getTextEncodingFromMimeCharset(";
71 // sError += pCharSet;
72 // sError += ") returns null";
73 // CPPUNIT_ASSERT_MESSAGE(sError.getStr(), eTextEnc != RTL_TEXTENCODING_DONTKNOW);
74 // CPPUNIT_ASSERT_MESSAGE("Does not realize itself", _aCurrentEncode == eTextEnc );
78 // the defines for the follows test could be found in file inc/rtl/textenc.h
80 // ----------------------------------------
81 void MimeCharsetFromTextEncoding_MS_1252()
83 check( "RTL_TEXTENCODING_MS_1252", RTL_TEXTENCODING_MS_1252
);
85 // ----------------------------------------
86 void MimeCharsetFromTextEncoding_APPLE_ROMAN()
88 check( "RTL_TEXTENCODING_APPLE_ROMAN", RTL_TEXTENCODING_APPLE_ROMAN
);
90 // ----------------------------------------
91 void MimeCharsetFromTextEncoding_IBM_437()
93 check( "RTL_TEXTENCODING_IBM_437", RTL_TEXTENCODING_IBM_437
);
95 // ----------------------------------------
96 void MimeCharsetFromTextEncoding_IBM_850()
98 check( "RTL_TEXTENCODING_IBM_850", RTL_TEXTENCODING_IBM_850
);
100 // ----------------------------------------
101 void MimeCharsetFromTextEncoding_IBM_860()
103 check( "RTL_TEXTENCODING_IBM_860", RTL_TEXTENCODING_IBM_860
);
105 // ----------------------------------------
106 void MimeCharsetFromTextEncoding_IBM_861()
108 check( "RTL_TEXTENCODING_IBM_861", RTL_TEXTENCODING_IBM_861
);
110 // ----------------------------------------
111 void MimeCharsetFromTextEncoding_IBM_863()
113 check( "RTL_TEXTENCODING_IBM_863", RTL_TEXTENCODING_IBM_863
);
115 // ----------------------------------------
116 void MimeCharsetFromTextEncoding_IBM_865()
118 check( "RTL_TEXTENCODING_IBM_865", RTL_TEXTENCODING_IBM_865
);
120 // ----------------------------------------
121 void MimeCharsetFromTextEncoding_SYMBOL()
123 check( "RTL_TEXTENCODING_SYMBOL", RTL_TEXTENCODING_SYMBOL
);
125 // ----------------------------------------
126 void MimeCharsetFromTextEncoding_ASCII_US()
128 check( "RTL_TEXTENCODING_ASCII_US", RTL_TEXTENCODING_ASCII_US
);
130 // ----------------------------------------
131 void MimeCharsetFromTextEncoding_ISO_8859_1()
133 check( "RTL_TEXTENCODING_ISO_8859_1", RTL_TEXTENCODING_ISO_8859_1
);
135 // ----------------------------------------
136 void MimeCharsetFromTextEncoding_ISO_8859_2()
138 check( "RTL_TEXTENCODING_ISO_8859_2", RTL_TEXTENCODING_ISO_8859_2
);
140 // ----------------------------------------
141 void MimeCharsetFromTextEncoding_ISO_8859_3()
143 check( "RTL_TEXTENCODING_ISO_8859_3", RTL_TEXTENCODING_ISO_8859_3
);
145 // ----------------------------------------
146 void MimeCharsetFromTextEncoding_ISO_8859_4()
148 check( "RTL_TEXTENCODING_ISO_8859_4", RTL_TEXTENCODING_ISO_8859_4
);
150 // ----------------------------------------
151 void MimeCharsetFromTextEncoding_ISO_8859_5()
153 check( "RTL_TEXTENCODING_ISO_8859_5", RTL_TEXTENCODING_ISO_8859_5
);
155 // ----------------------------------------
156 void MimeCharsetFromTextEncoding_ISO_8859_6()
158 check( "RTL_TEXTENCODING_ISO_8859_6", RTL_TEXTENCODING_ISO_8859_6
);
160 // ----------------------------------------
161 void MimeCharsetFromTextEncoding_ISO_8859_7()
163 check( "RTL_TEXTENCODING_ISO_8859_7", RTL_TEXTENCODING_ISO_8859_7
);
165 // ----------------------------------------
166 void MimeCharsetFromTextEncoding_ISO_8859_8()
168 check( "RTL_TEXTENCODING_ISO_8859_8", RTL_TEXTENCODING_ISO_8859_8
);
170 // ----------------------------------------
171 void MimeCharsetFromTextEncoding_ISO_8859_9()
173 check( "RTL_TEXTENCODING_ISO_8859_9", RTL_TEXTENCODING_ISO_8859_9
);
175 // ----------------------------------------
176 void MimeCharsetFromTextEncoding_ISO_8859_14()
178 check( "RTL_TEXTENCODING_ISO_8859_14", RTL_TEXTENCODING_ISO_8859_14
);
180 // ----------------------------------------
181 void MimeCharsetFromTextEncoding_ISO_8859_15()
183 check( "RTL_TEXTENCODING_ISO_8859_15", RTL_TEXTENCODING_ISO_8859_15
);
185 // ----------------------------------------
186 void MimeCharsetFromTextEncoding_IBM_737()
188 check( "RTL_TEXTENCODING_IBM_737", RTL_TEXTENCODING_IBM_737
);
190 // ----------------------------------------
191 void MimeCharsetFromTextEncoding_IBM_775()
193 check( "RTL_TEXTENCODING_IBM_775", RTL_TEXTENCODING_IBM_775
);
195 // ----------------------------------------
196 void MimeCharsetFromTextEncoding_IBM_852()
198 check( "RTL_TEXTENCODING_IBM_852", RTL_TEXTENCODING_IBM_852
);
200 // ----------------------------------------
201 void MimeCharsetFromTextEncoding_IBM_855()
203 check( "RTL_TEXTENCODING_IBM_855", RTL_TEXTENCODING_IBM_855
);
205 // ----------------------------------------
206 void MimeCharsetFromTextEncoding_IBM_857()
208 check( "RTL_TEXTENCODING_IBM_857", RTL_TEXTENCODING_IBM_857
);
210 // ----------------------------------------
211 void MimeCharsetFromTextEncoding_IBM_862()
213 check( "RTL_TEXTENCODING_IBM_862", RTL_TEXTENCODING_IBM_862
);
215 // ----------------------------------------
216 void MimeCharsetFromTextEncoding_IBM_864()
218 check( "RTL_TEXTENCODING_IBM_864", RTL_TEXTENCODING_IBM_864
);
220 // ----------------------------------------
221 void MimeCharsetFromTextEncoding_IBM_866()
223 check( "RTL_TEXTENCODING_IBM_866", RTL_TEXTENCODING_IBM_866
);
225 // ----------------------------------------
226 void MimeCharsetFromTextEncoding_IBM_869()
228 check( "RTL_TEXTENCODING_IBM_869", RTL_TEXTENCODING_IBM_869
);
230 // ----------------------------------------
231 void MimeCharsetFromTextEncoding_MS_874()
233 check( "RTL_TEXTENCODING_MS_874", RTL_TEXTENCODING_MS_874
);
235 // ----------------------------------------
236 void MimeCharsetFromTextEncoding_MS_1250()
238 check( "RTL_TEXTENCODING_MS_1250", RTL_TEXTENCODING_MS_1250
);
240 // ----------------------------------------
241 void MimeCharsetFromTextEncoding_MS_1251()
243 check( "RTL_TEXTENCODING_MS_1251", RTL_TEXTENCODING_MS_1251
);
245 // ----------------------------------------
246 void MimeCharsetFromTextEncoding_MS_1253()
248 check( "RTL_TEXTENCODING_MS_1253", RTL_TEXTENCODING_MS_1253
);
250 // ----------------------------------------
251 void MimeCharsetFromTextEncoding_MS_1254()
253 check( "RTL_TEXTENCODING_MS_1254", RTL_TEXTENCODING_MS_1254
);
255 // ----------------------------------------
256 void MimeCharsetFromTextEncoding_MS_1255()
258 check( "RTL_TEXTENCODING_MS_1255", RTL_TEXTENCODING_MS_1255
);
260 // ----------------------------------------
261 void MimeCharsetFromTextEncoding_MS_1256()
263 check( "RTL_TEXTENCODING_MS_1256", RTL_TEXTENCODING_MS_1256
);
265 // ----------------------------------------
266 void MimeCharsetFromTextEncoding_MS_1257()
268 check( "RTL_TEXTENCODING_MS_1257", RTL_TEXTENCODING_MS_1257
);
270 // ----------------------------------------
271 void MimeCharsetFromTextEncoding_MS_1258()
273 check( "RTL_TEXTENCODING_MS_1258", RTL_TEXTENCODING_MS_1258
);
275 // ----------------------------------------
276 void MimeCharsetFromTextEncoding_APPLE_ARABIC()
278 check( "RTL_TEXTENCODING_APPLE_ARABIC", RTL_TEXTENCODING_APPLE_ARABIC
);
280 // ----------------------------------------
281 void MimeCharsetFromTextEncoding_APPLE_CENTEURO()
283 check( "RTL_TEXTENCODING_APPLE_CENTEURO", RTL_TEXTENCODING_APPLE_CENTEURO
);
285 // ----------------------------------------
286 void MimeCharsetFromTextEncoding_APPLE_CROATIAN()
288 check( "RTL_TEXTENCODING_APPLE_CROATIAN", RTL_TEXTENCODING_APPLE_CROATIAN
);
290 // ----------------------------------------
291 void MimeCharsetFromTextEncoding_APPLE_CYRILLIC()
293 check( "RTL_TEXTENCODING_APPLE_CYRILLIC", RTL_TEXTENCODING_APPLE_CYRILLIC
);
295 // ----------------------------------------
296 void MimeCharsetFromTextEncoding_APPLE_DEVANAGARI()
298 check( "RTL_TEXTENCODING_APPLE_DEVANAGARI", RTL_TEXTENCODING_APPLE_DEVANAGARI
);
300 // ----------------------------------------
301 void MimeCharsetFromTextEncoding_APPLE_FARSI()
303 check( "RTL_TEXTENCODING_APPLE_FARSI", RTL_TEXTENCODING_APPLE_FARSI
);
305 // ----------------------------------------
306 void MimeCharsetFromTextEncoding_APPLE_GREEK()
308 check( "RTL_TEXTENCODING_APPLE_GREEK", RTL_TEXTENCODING_APPLE_GREEK
);
310 // ----------------------------------------
311 void MimeCharsetFromTextEncoding_APPLE_GUJARATI()
313 check( "RTL_TEXTENCODING_APPLE_GUJARATI", RTL_TEXTENCODING_APPLE_GUJARATI
);
315 // ----------------------------------------
316 void MimeCharsetFromTextEncoding_APPLE_GURMUKHI()
318 check( "RTL_TEXTENCODING_APPLE_GURMUKHI", RTL_TEXTENCODING_APPLE_GURMUKHI
);
320 // ----------------------------------------
321 void MimeCharsetFromTextEncoding_APPLE_HEBREW()
323 check( "RTL_TEXTENCODING_APPLE_HEBREW", RTL_TEXTENCODING_APPLE_HEBREW
);
325 // ----------------------------------------
326 void MimeCharsetFromTextEncoding_APPLE_ICELAND()
328 check( "RTL_TEXTENCODING_APPLE_ICELAND", RTL_TEXTENCODING_APPLE_ICELAND
);
330 // ----------------------------------------
331 void MimeCharsetFromTextEncoding_APPLE_ROMANIAN()
333 check( "RTL_TEXTENCODING_APPLE_ROMANIAN", RTL_TEXTENCODING_APPLE_ROMANIAN
);
335 // ----------------------------------------
336 void MimeCharsetFromTextEncoding_APPLE_THAI()
338 check( "RTL_TEXTENCODING_APPLE_THAI", RTL_TEXTENCODING_APPLE_THAI
);
340 // ----------------------------------------
341 void MimeCharsetFromTextEncoding_APPLE_TURKISH()
343 check( "RTL_TEXTENCODING_APPLE_TURKISH", RTL_TEXTENCODING_APPLE_TURKISH
);
345 // ----------------------------------------
346 void MimeCharsetFromTextEncoding_APPLE_UKRAINIAN()
348 check( "RTL_TEXTENCODING_APPLE_UKRAINIAN", RTL_TEXTENCODING_APPLE_UKRAINIAN
);
350 // ----------------------------------------
351 void MimeCharsetFromTextEncoding_APPLE_CHINSIMP()
353 check( "RTL_TEXTENCODING_APPLE_CHINSIMP", RTL_TEXTENCODING_APPLE_CHINSIMP
);
355 // ----------------------------------------
356 void MimeCharsetFromTextEncoding_APPLE_CHINTRAD()
358 check( "RTL_TEXTENCODING_APPLE_CHINTRAD", RTL_TEXTENCODING_APPLE_CHINTRAD
);
360 // ----------------------------------------
361 void MimeCharsetFromTextEncoding_APPLE_JAPANESE()
363 check( "RTL_TEXTENCODING_APPLE_JAPANESE", RTL_TEXTENCODING_APPLE_JAPANESE
);
365 // ----------------------------------------
366 void MimeCharsetFromTextEncoding_APPLE_KOREAN()
368 check( "RTL_TEXTENCODING_APPLE_KOREAN", RTL_TEXTENCODING_APPLE_KOREAN
);
370 // ----------------------------------------
371 void MimeCharsetFromTextEncoding_MS_932()
373 check( "RTL_TEXTENCODING_MS_932", RTL_TEXTENCODING_MS_932
);
375 // ----------------------------------------
376 void MimeCharsetFromTextEncoding_MS_936()
378 check( "RTL_TEXTENCODING_MS_936", RTL_TEXTENCODING_MS_936
);
380 // ----------------------------------------
381 void MimeCharsetFromTextEncoding_MS_949()
383 check( "RTL_TEXTENCODING_MS_949", RTL_TEXTENCODING_MS_949
);
385 // ----------------------------------------
386 void MimeCharsetFromTextEncoding_MS_950()
388 check( "RTL_TEXTENCODING_MS_950", RTL_TEXTENCODING_MS_950
);
390 // ----------------------------------------
391 void MimeCharsetFromTextEncoding_SHIFT_JIS()
393 check( "RTL_TEXTENCODING_SHIFT_JIS", RTL_TEXTENCODING_SHIFT_JIS
);
395 // ----------------------------------------
396 void MimeCharsetFromTextEncoding_GB_2312()
398 check( "RTL_TEXTENCODING_GB_2312", RTL_TEXTENCODING_GB_2312
);
400 // ----------------------------------------
401 void MimeCharsetFromTextEncoding_GBT_12345()
403 check( "RTL_TEXTENCODING_GBT_12345", RTL_TEXTENCODING_GBT_12345
);
405 // ----------------------------------------
406 void MimeCharsetFromTextEncoding_GBK()
408 check( "RTL_TEXTENCODING_GBK", RTL_TEXTENCODING_GBK
);
410 // ----------------------------------------
411 void MimeCharsetFromTextEncoding_BIG5()
413 check( "RTL_TEXTENCODING_BIG5", RTL_TEXTENCODING_BIG5
);
415 // ----------------------------------------
416 void MimeCharsetFromTextEncoding_EUC_JP()
418 check( "RTL_TEXTENCODING_EUC_JP", RTL_TEXTENCODING_EUC_JP
);
420 // ----------------------------------------
421 void MimeCharsetFromTextEncoding_EUC_CN()
423 check( "RTL_TEXTENCODING_EUC_CN", RTL_TEXTENCODING_EUC_CN
);
425 // ----------------------------------------
426 void MimeCharsetFromTextEncoding_EUC_TW()
428 check( "RTL_TEXTENCODING_EUC_TW", RTL_TEXTENCODING_EUC_TW
);
430 // ----------------------------------------
431 void MimeCharsetFromTextEncoding_ISO_2022_JP()
433 check( "RTL_TEXTENCODING_ISO_2022_JP", RTL_TEXTENCODING_ISO_2022_JP
);
435 // ----------------------------------------
436 void MimeCharsetFromTextEncoding_ISO_2022_CN()
438 check( "RTL_TEXTENCODING_ISO_2022_CN", RTL_TEXTENCODING_ISO_2022_CN
);
440 // ----------------------------------------
441 void MimeCharsetFromTextEncoding_KOI8_R()
443 check( "RTL_TEXTENCODING_KOI8_R", RTL_TEXTENCODING_KOI8_R
);
445 // ----------------------------------------
446 void MimeCharsetFromTextEncoding_UTF7()
448 check( "RTL_TEXTENCODING_UTF7", RTL_TEXTENCODING_UTF7
);
450 // ----------------------------------------
451 void MimeCharsetFromTextEncoding_UTF8()
453 check( "RTL_TEXTENCODING_UTF8", RTL_TEXTENCODING_UTF8
);
455 // ----------------------------------------
456 void MimeCharsetFromTextEncoding_ISO_8859_10()
458 check( "RTL_TEXTENCODING_ISO_8859_10", RTL_TEXTENCODING_ISO_8859_10
);
460 // ----------------------------------------
461 void MimeCharsetFromTextEncoding_ISO_8859_13()
463 check( "RTL_TEXTENCODING_ISO_8859_13", RTL_TEXTENCODING_ISO_8859_13
);
465 // ----------------------------------------
466 void MimeCharsetFromTextEncoding_EUC_KR()
468 check( "RTL_TEXTENCODING_EUC_KR", RTL_TEXTENCODING_EUC_KR
);
470 // ----------------------------------------
471 void MimeCharsetFromTextEncoding_ISO_2022_KR()
473 check( "RTL_TEXTENCODING_ISO_2022_KR", RTL_TEXTENCODING_ISO_2022_KR
);
475 // ----------------------------------------
476 void MimeCharsetFromTextEncoding_JIS_X_0201()
478 check( "RTL_TEXTENCODING_JIS_X_0201", RTL_TEXTENCODING_JIS_X_0201
);
480 // ----------------------------------------
481 void MimeCharsetFromTextEncoding_JIS_X_0208()
483 check( "RTL_TEXTENCODING_JIS_X_0208", RTL_TEXTENCODING_JIS_X_0208
);
485 // ----------------------------------------
486 void MimeCharsetFromTextEncoding_JIS_X_0212()
488 check( "RTL_TEXTENCODING_JIS_X_0212", RTL_TEXTENCODING_JIS_X_0212
);
490 // ----------------------------------------
491 void MimeCharsetFromTextEncoding_MS_1361()
493 check( "RTL_TEXTENCODING_MS_1361", RTL_TEXTENCODING_MS_1361
);
495 // ----------------------------------------
496 void MimeCharsetFromTextEncoding_GB_18030()
498 check( "RTL_TEXTENCODING_GB_18030", RTL_TEXTENCODING_GB_18030
);
500 // ----------------------------------------
501 void MimeCharsetFromTextEncoding_BIG5_HKSCS()
503 check( "RTL_TEXTENCODING_BIG5_HKSCS", RTL_TEXTENCODING_BIG5_HKSCS
);
505 // ----------------------------------------
506 void MimeCharsetFromTextEncoding_TIS_620()
508 check( "RTL_TEXTENCODING_TIS_620", RTL_TEXTENCODING_TIS_620
);
510 // ----------------------------------------
511 void MimeCharsetFromTextEncoding_KOI8_U()
513 check( "RTL_TEXTENCODING_KOI8_U", RTL_TEXTENCODING_KOI8_U
);
515 // ----------------------------------------
516 void MimeCharsetFromTextEncoding_ISCII_DEVANAGARI()
518 check( "RTL_TEXTENCODING_ISCII_DEVANAGARI", RTL_TEXTENCODING_ISCII_DEVANAGARI
);
520 // ----------------------------------------
521 void MimeCharsetFromTextEncoding_JAVA_UTF8()
523 check( "RTL_TEXTENCODING_JAVA_UTF8", RTL_TEXTENCODING_JAVA_UTF8
);
526 /* ATTENTION! Whenever some encoding is added here, make sure to update
527 * rtl_isOctetEncoding in tencinfo.c.
530 // RTL_TEXTENCODING_USER_START
531 // RTL_TEXTENCODING_USER_END
533 // check( "RTL_TEXTENCODING_UCS4", RTL_TEXTENCODING_UCS4 );
534 // check( "RTL_TEXTENCODING_UCS2", RTL_TEXTENCODING_UCS2 );
535 // check( "RTL_TEXTENCODING_UNICODE", RTL_TEXTENCODING_UNICODE /* RTL_TEXTENCODING_UCS2 */ );
537 CPPUNIT_TEST_SUITE( getBestMime
);
539 CPPUNIT_TEST( MimeCharsetFromTextEncoding_MS_1252
);
540 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_ROMAN
);
541 CPPUNIT_TEST( MimeCharsetFromTextEncoding_IBM_437
);
542 CPPUNIT_TEST( MimeCharsetFromTextEncoding_IBM_850
);
543 CPPUNIT_TEST( MimeCharsetFromTextEncoding_IBM_860
);
544 CPPUNIT_TEST( MimeCharsetFromTextEncoding_IBM_861
);
545 CPPUNIT_TEST( MimeCharsetFromTextEncoding_IBM_863
);
546 CPPUNIT_TEST( MimeCharsetFromTextEncoding_IBM_865
);
547 CPPUNIT_TEST( MimeCharsetFromTextEncoding_SYMBOL
);
548 CPPUNIT_TEST( MimeCharsetFromTextEncoding_ASCII_US
);
549 CPPUNIT_TEST( MimeCharsetFromTextEncoding_ISO_8859_1
);
550 CPPUNIT_TEST( MimeCharsetFromTextEncoding_ISO_8859_2
);
551 CPPUNIT_TEST( MimeCharsetFromTextEncoding_ISO_8859_3
);
552 CPPUNIT_TEST( MimeCharsetFromTextEncoding_ISO_8859_4
);
553 CPPUNIT_TEST( MimeCharsetFromTextEncoding_ISO_8859_5
);
554 CPPUNIT_TEST( MimeCharsetFromTextEncoding_ISO_8859_6
);
555 CPPUNIT_TEST( MimeCharsetFromTextEncoding_ISO_8859_7
);
556 CPPUNIT_TEST( MimeCharsetFromTextEncoding_ISO_8859_8
);
557 CPPUNIT_TEST( MimeCharsetFromTextEncoding_ISO_8859_9
);
558 CPPUNIT_TEST( MimeCharsetFromTextEncoding_ISO_8859_14
);
559 CPPUNIT_TEST( MimeCharsetFromTextEncoding_ISO_8859_15
);
560 CPPUNIT_TEST( MimeCharsetFromTextEncoding_IBM_737
);
561 CPPUNIT_TEST( MimeCharsetFromTextEncoding_IBM_775
);
562 CPPUNIT_TEST( MimeCharsetFromTextEncoding_IBM_852
);
563 CPPUNIT_TEST( MimeCharsetFromTextEncoding_IBM_855
);
564 CPPUNIT_TEST( MimeCharsetFromTextEncoding_IBM_857
);
565 CPPUNIT_TEST( MimeCharsetFromTextEncoding_IBM_862
);
566 CPPUNIT_TEST( MimeCharsetFromTextEncoding_IBM_864
);
567 CPPUNIT_TEST( MimeCharsetFromTextEncoding_IBM_866
);
568 CPPUNIT_TEST( MimeCharsetFromTextEncoding_IBM_869
);
569 CPPUNIT_TEST( MimeCharsetFromTextEncoding_MS_874
);
570 CPPUNIT_TEST( MimeCharsetFromTextEncoding_MS_1250
);
571 CPPUNIT_TEST( MimeCharsetFromTextEncoding_MS_1251
);
572 CPPUNIT_TEST( MimeCharsetFromTextEncoding_MS_1253
);
573 CPPUNIT_TEST( MimeCharsetFromTextEncoding_MS_1254
);
574 CPPUNIT_TEST( MimeCharsetFromTextEncoding_MS_1255
);
575 CPPUNIT_TEST( MimeCharsetFromTextEncoding_MS_1256
);
576 CPPUNIT_TEST( MimeCharsetFromTextEncoding_MS_1257
);
577 CPPUNIT_TEST( MimeCharsetFromTextEncoding_MS_1258
);
578 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_ARABIC
);
579 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_CENTEURO
);
580 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_CROATIAN
);
581 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_CYRILLIC
);
582 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_DEVANAGARI
);
583 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_FARSI
);
584 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_GREEK
);
585 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_GUJARATI
);
586 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_GURMUKHI
);
587 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_HEBREW
);
588 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_ICELAND
);
589 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_ROMANIAN
);
590 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_THAI
);
591 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_TURKISH
);
592 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_UKRAINIAN
);
593 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_CHINSIMP
);
594 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_CHINTRAD
);
595 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_JAPANESE
);
596 CPPUNIT_TEST( MimeCharsetFromTextEncoding_APPLE_KOREAN
);
597 CPPUNIT_TEST( MimeCharsetFromTextEncoding_MS_932
);
598 CPPUNIT_TEST( MimeCharsetFromTextEncoding_MS_936
);
599 CPPUNIT_TEST( MimeCharsetFromTextEncoding_MS_949
);
600 CPPUNIT_TEST( MimeCharsetFromTextEncoding_MS_950
);
601 CPPUNIT_TEST( MimeCharsetFromTextEncoding_SHIFT_JIS
);
602 CPPUNIT_TEST( MimeCharsetFromTextEncoding_GB_2312
);
603 CPPUNIT_TEST( MimeCharsetFromTextEncoding_GBT_12345
);
604 CPPUNIT_TEST( MimeCharsetFromTextEncoding_GBK
);
605 CPPUNIT_TEST( MimeCharsetFromTextEncoding_BIG5
);
606 CPPUNIT_TEST( MimeCharsetFromTextEncoding_EUC_JP
);
607 CPPUNIT_TEST( MimeCharsetFromTextEncoding_EUC_CN
);
608 CPPUNIT_TEST( MimeCharsetFromTextEncoding_EUC_TW
);
609 CPPUNIT_TEST( MimeCharsetFromTextEncoding_ISO_2022_JP
);
610 CPPUNIT_TEST( MimeCharsetFromTextEncoding_ISO_2022_CN
);
611 CPPUNIT_TEST( MimeCharsetFromTextEncoding_KOI8_R
);
612 CPPUNIT_TEST( MimeCharsetFromTextEncoding_UTF7
);
613 CPPUNIT_TEST( MimeCharsetFromTextEncoding_UTF8
);
614 CPPUNIT_TEST( MimeCharsetFromTextEncoding_ISO_8859_10
);
615 CPPUNIT_TEST( MimeCharsetFromTextEncoding_ISO_8859_13
);
616 CPPUNIT_TEST( MimeCharsetFromTextEncoding_EUC_KR
);
617 CPPUNIT_TEST( MimeCharsetFromTextEncoding_ISO_2022_KR
);
618 CPPUNIT_TEST( MimeCharsetFromTextEncoding_JIS_X_0201
);
619 CPPUNIT_TEST( MimeCharsetFromTextEncoding_JIS_X_0208
);
620 CPPUNIT_TEST( MimeCharsetFromTextEncoding_JIS_X_0212
);
621 CPPUNIT_TEST( MimeCharsetFromTextEncoding_MS_1361
);
622 CPPUNIT_TEST( MimeCharsetFromTextEncoding_GB_18030
);
623 CPPUNIT_TEST( MimeCharsetFromTextEncoding_BIG5_HKSCS
);
624 CPPUNIT_TEST( MimeCharsetFromTextEncoding_TIS_620
);
625 CPPUNIT_TEST( MimeCharsetFromTextEncoding_KOI8_U
);
626 CPPUNIT_TEST( MimeCharsetFromTextEncoding_ISCII_DEVANAGARI
);
627 CPPUNIT_TEST( MimeCharsetFromTextEncoding_JAVA_UTF8
);
629 CPPUNIT_TEST_SUITE_END( );
632 // -----------------------------------------------------------------------------
634 class getBestUnix
: public CppUnit::TestFixture
641 void check( const sal_Char
* _pRTL_TEXTENCODING
, rtl_TextEncoding _aCurrentEncode
)
643 const sal_Char
*pCharSet
= rtl_getBestUnixCharsetFromTextEncoding( _aCurrentEncode
);
646 t_print("rtl_getBestUnixCharsetFromTextEncoding(%s) (%d) doesn't seem to exist.\n\n", _pRTL_TEXTENCODING
, _aCurrentEncode
);
650 t_print(T_VERBOSE
, "'%s' is charset: '%s'\n", _pRTL_TEXTENCODING
, pCharSet
);
652 rtl_TextEncoding eTextEnc
= rtl_getTextEncodingFromUnixCharset( pCharSet
);
653 if (_aCurrentEncode
!= eTextEnc
&&
654 eTextEnc
!= RTL_TEXTENCODING_DONTKNOW
)
656 t_print("rtl_getBestUnixCharsetFromTextEncoding(%s) is charset: %s\n", _pRTL_TEXTENCODING
, pCharSet
);
657 t_print("rtl_getTextEncodingFromUnixCharset() differ: %s %d -> %d\n\n", _pRTL_TEXTENCODING
, _aCurrentEncode
, eTextEnc
);
659 // rtl::OString sError = "getTextEncodingFromUnixCharset(";
660 // sError += pCharSet;
661 // sError += ") returns null";
662 // CPPUNIT_ASSERT_MESSAGE(sError.getStr(), eTextEnc != RTL_TEXTENCODING_DONTKNOW);
663 // CPPUNIT_ASSERT_MESSAGE("Does not realize itself", _aCurrentEncode == eTextEnc );
668 // ----------------------------------------
669 void UnixCharsetFromTextEncoding_MS_1252()
671 check( "RTL_TEXTENCODING_MS_1252", RTL_TEXTENCODING_MS_1252
);
673 // ----------------------------------------
674 void UnixCharsetFromTextEncoding_APPLE_ROMAN()
676 check( "RTL_TEXTENCODING_APPLE_ROMAN", RTL_TEXTENCODING_APPLE_ROMAN
);
678 // ----------------------------------------
679 void UnixCharsetFromTextEncoding_IBM_437()
681 check( "RTL_TEXTENCODING_IBM_437", RTL_TEXTENCODING_IBM_437
);
683 // ----------------------------------------
684 void UnixCharsetFromTextEncoding_IBM_850()
686 check( "RTL_TEXTENCODING_IBM_850", RTL_TEXTENCODING_IBM_850
);
688 // ----------------------------------------
689 void UnixCharsetFromTextEncoding_IBM_860()
691 check( "RTL_TEXTENCODING_IBM_860", RTL_TEXTENCODING_IBM_860
);
693 // ----------------------------------------
694 void UnixCharsetFromTextEncoding_IBM_861()
696 check( "RTL_TEXTENCODING_IBM_861", RTL_TEXTENCODING_IBM_861
);
698 // ----------------------------------------
699 void UnixCharsetFromTextEncoding_IBM_863()
701 check( "RTL_TEXTENCODING_IBM_863", RTL_TEXTENCODING_IBM_863
);
703 // ----------------------------------------
704 void UnixCharsetFromTextEncoding_IBM_865()
706 check( "RTL_TEXTENCODING_IBM_865", RTL_TEXTENCODING_IBM_865
);
708 // ----------------------------------------
709 void UnixCharsetFromTextEncoding_SYMBOL()
711 check( "RTL_TEXTENCODING_SYMBOL", RTL_TEXTENCODING_SYMBOL
);
713 // ----------------------------------------
714 void UnixCharsetFromTextEncoding_ASCII_US()
716 check( "RTL_TEXTENCODING_ASCII_US", RTL_TEXTENCODING_ASCII_US
);
718 // ----------------------------------------
719 void UnixCharsetFromTextEncoding_ISO_8859_1()
721 check( "RTL_TEXTENCODING_ISO_8859_1", RTL_TEXTENCODING_ISO_8859_1
);
723 // ----------------------------------------
724 void UnixCharsetFromTextEncoding_ISO_8859_2()
726 check( "RTL_TEXTENCODING_ISO_8859_2", RTL_TEXTENCODING_ISO_8859_2
);
728 // ----------------------------------------
729 void UnixCharsetFromTextEncoding_ISO_8859_3()
731 check( "RTL_TEXTENCODING_ISO_8859_3", RTL_TEXTENCODING_ISO_8859_3
);
733 // ----------------------------------------
734 void UnixCharsetFromTextEncoding_ISO_8859_4()
736 check( "RTL_TEXTENCODING_ISO_8859_4", RTL_TEXTENCODING_ISO_8859_4
);
738 // ----------------------------------------
739 void UnixCharsetFromTextEncoding_ISO_8859_5()
741 check( "RTL_TEXTENCODING_ISO_8859_5", RTL_TEXTENCODING_ISO_8859_5
);
743 // ----------------------------------------
744 void UnixCharsetFromTextEncoding_ISO_8859_6()
746 check( "RTL_TEXTENCODING_ISO_8859_6", RTL_TEXTENCODING_ISO_8859_6
);
748 // ----------------------------------------
749 void UnixCharsetFromTextEncoding_ISO_8859_7()
751 check( "RTL_TEXTENCODING_ISO_8859_7", RTL_TEXTENCODING_ISO_8859_7
);
753 // ----------------------------------------
754 void UnixCharsetFromTextEncoding_ISO_8859_8()
756 check( "RTL_TEXTENCODING_ISO_8859_8", RTL_TEXTENCODING_ISO_8859_8
);
758 // ----------------------------------------
759 void UnixCharsetFromTextEncoding_ISO_8859_9()
761 check( "RTL_TEXTENCODING_ISO_8859_9", RTL_TEXTENCODING_ISO_8859_9
);
763 // ----------------------------------------
764 void UnixCharsetFromTextEncoding_ISO_8859_14()
766 check( "RTL_TEXTENCODING_ISO_8859_14", RTL_TEXTENCODING_ISO_8859_14
);
768 // ----------------------------------------
769 void UnixCharsetFromTextEncoding_ISO_8859_15()
771 check( "RTL_TEXTENCODING_ISO_8859_15", RTL_TEXTENCODING_ISO_8859_15
);
773 // ----------------------------------------
774 void UnixCharsetFromTextEncoding_IBM_737()
776 check( "RTL_TEXTENCODING_IBM_737", RTL_TEXTENCODING_IBM_737
);
778 // ----------------------------------------
779 void UnixCharsetFromTextEncoding_IBM_775()
781 check( "RTL_TEXTENCODING_IBM_775", RTL_TEXTENCODING_IBM_775
);
783 // ----------------------------------------
784 void UnixCharsetFromTextEncoding_IBM_852()
786 check( "RTL_TEXTENCODING_IBM_852", RTL_TEXTENCODING_IBM_852
);
788 // ----------------------------------------
789 void UnixCharsetFromTextEncoding_IBM_855()
791 check( "RTL_TEXTENCODING_IBM_855", RTL_TEXTENCODING_IBM_855
);
793 // ----------------------------------------
794 void UnixCharsetFromTextEncoding_IBM_857()
796 check( "RTL_TEXTENCODING_IBM_857", RTL_TEXTENCODING_IBM_857
);
798 // ----------------------------------------
799 void UnixCharsetFromTextEncoding_IBM_862()
801 check( "RTL_TEXTENCODING_IBM_862", RTL_TEXTENCODING_IBM_862
);
803 // ----------------------------------------
804 void UnixCharsetFromTextEncoding_IBM_864()
806 check( "RTL_TEXTENCODING_IBM_864", RTL_TEXTENCODING_IBM_864
);
808 // ----------------------------------------
809 void UnixCharsetFromTextEncoding_IBM_866()
811 check( "RTL_TEXTENCODING_IBM_866", RTL_TEXTENCODING_IBM_866
);
813 // ----------------------------------------
814 void UnixCharsetFromTextEncoding_IBM_869()
816 check( "RTL_TEXTENCODING_IBM_869", RTL_TEXTENCODING_IBM_869
);
818 // ----------------------------------------
819 void UnixCharsetFromTextEncoding_MS_874()
821 check( "RTL_TEXTENCODING_MS_874", RTL_TEXTENCODING_MS_874
);
823 // ----------------------------------------
824 void UnixCharsetFromTextEncoding_MS_1250()
826 check( "RTL_TEXTENCODING_MS_1250", RTL_TEXTENCODING_MS_1250
);
828 // ----------------------------------------
829 void UnixCharsetFromTextEncoding_MS_1251()
831 check( "RTL_TEXTENCODING_MS_1251", RTL_TEXTENCODING_MS_1251
);
833 // ----------------------------------------
834 void UnixCharsetFromTextEncoding_MS_1253()
836 check( "RTL_TEXTENCODING_MS_1253", RTL_TEXTENCODING_MS_1253
);
838 // ----------------------------------------
839 void UnixCharsetFromTextEncoding_MS_1254()
841 check( "RTL_TEXTENCODING_MS_1254", RTL_TEXTENCODING_MS_1254
);
843 // ----------------------------------------
844 void UnixCharsetFromTextEncoding_MS_1255()
846 check( "RTL_TEXTENCODING_MS_1255", RTL_TEXTENCODING_MS_1255
);
848 // ----------------------------------------
849 void UnixCharsetFromTextEncoding_MS_1256()
851 check( "RTL_TEXTENCODING_MS_1256", RTL_TEXTENCODING_MS_1256
);
853 // ----------------------------------------
854 void UnixCharsetFromTextEncoding_MS_1257()
856 check( "RTL_TEXTENCODING_MS_1257", RTL_TEXTENCODING_MS_1257
);
858 // ----------------------------------------
859 void UnixCharsetFromTextEncoding_MS_1258()
861 check( "RTL_TEXTENCODING_MS_1258", RTL_TEXTENCODING_MS_1258
);
863 // ----------------------------------------
864 void UnixCharsetFromTextEncoding_APPLE_ARABIC()
866 check( "RTL_TEXTENCODING_APPLE_ARABIC", RTL_TEXTENCODING_APPLE_ARABIC
);
868 // ----------------------------------------
869 void UnixCharsetFromTextEncoding_APPLE_CENTEURO()
871 check( "RTL_TEXTENCODING_APPLE_CENTEURO", RTL_TEXTENCODING_APPLE_CENTEURO
);
873 // ----------------------------------------
874 void UnixCharsetFromTextEncoding_APPLE_CROATIAN()
876 check( "RTL_TEXTENCODING_APPLE_CROATIAN", RTL_TEXTENCODING_APPLE_CROATIAN
);
878 // ----------------------------------------
879 void UnixCharsetFromTextEncoding_APPLE_CYRILLIC()
881 check( "RTL_TEXTENCODING_APPLE_CYRILLIC", RTL_TEXTENCODING_APPLE_CYRILLIC
);
883 // ----------------------------------------
884 void UnixCharsetFromTextEncoding_APPLE_DEVANAGARI()
886 check( "RTL_TEXTENCODING_APPLE_DEVANAGARI", RTL_TEXTENCODING_APPLE_DEVANAGARI
);
888 // ----------------------------------------
889 void UnixCharsetFromTextEncoding_APPLE_FARSI()
891 check( "RTL_TEXTENCODING_APPLE_FARSI", RTL_TEXTENCODING_APPLE_FARSI
);
893 // ----------------------------------------
894 void UnixCharsetFromTextEncoding_APPLE_GREEK()
896 check( "RTL_TEXTENCODING_APPLE_GREEK", RTL_TEXTENCODING_APPLE_GREEK
);
898 // ----------------------------------------
899 void UnixCharsetFromTextEncoding_APPLE_GUJARATI()
901 check( "RTL_TEXTENCODING_APPLE_GUJARATI", RTL_TEXTENCODING_APPLE_GUJARATI
);
903 // ----------------------------------------
904 void UnixCharsetFromTextEncoding_APPLE_GURMUKHI()
906 check( "RTL_TEXTENCODING_APPLE_GURMUKHI", RTL_TEXTENCODING_APPLE_GURMUKHI
);
908 // ----------------------------------------
909 void UnixCharsetFromTextEncoding_APPLE_HEBREW()
911 check( "RTL_TEXTENCODING_APPLE_HEBREW", RTL_TEXTENCODING_APPLE_HEBREW
);
913 // ----------------------------------------
914 void UnixCharsetFromTextEncoding_APPLE_ICELAND()
916 check( "RTL_TEXTENCODING_APPLE_ICELAND", RTL_TEXTENCODING_APPLE_ICELAND
);
918 // ----------------------------------------
919 void UnixCharsetFromTextEncoding_APPLE_ROMANIAN()
921 check( "RTL_TEXTENCODING_APPLE_ROMANIAN", RTL_TEXTENCODING_APPLE_ROMANIAN
);
923 // ----------------------------------------
924 void UnixCharsetFromTextEncoding_APPLE_THAI()
926 check( "RTL_TEXTENCODING_APPLE_THAI", RTL_TEXTENCODING_APPLE_THAI
);
928 // ----------------------------------------
929 void UnixCharsetFromTextEncoding_APPLE_TURKISH()
931 check( "RTL_TEXTENCODING_APPLE_TURKISH", RTL_TEXTENCODING_APPLE_TURKISH
);
933 // ----------------------------------------
934 void UnixCharsetFromTextEncoding_APPLE_UKRAINIAN()
936 check( "RTL_TEXTENCODING_APPLE_UKRAINIAN", RTL_TEXTENCODING_APPLE_UKRAINIAN
);
938 // ----------------------------------------
939 void UnixCharsetFromTextEncoding_APPLE_CHINSIMP()
941 check( "RTL_TEXTENCODING_APPLE_CHINSIMP", RTL_TEXTENCODING_APPLE_CHINSIMP
);
943 // ----------------------------------------
944 void UnixCharsetFromTextEncoding_APPLE_CHINTRAD()
946 check( "RTL_TEXTENCODING_APPLE_CHINTRAD", RTL_TEXTENCODING_APPLE_CHINTRAD
);
948 // ----------------------------------------
949 void UnixCharsetFromTextEncoding_APPLE_JAPANESE()
951 check( "RTL_TEXTENCODING_APPLE_JAPANESE", RTL_TEXTENCODING_APPLE_JAPANESE
);
953 // ----------------------------------------
954 void UnixCharsetFromTextEncoding_APPLE_KOREAN()
956 check( "RTL_TEXTENCODING_APPLE_KOREAN", RTL_TEXTENCODING_APPLE_KOREAN
);
958 // ----------------------------------------
959 void UnixCharsetFromTextEncoding_MS_932()
961 check( "RTL_TEXTENCODING_MS_932", RTL_TEXTENCODING_MS_932
);
963 // ----------------------------------------
964 void UnixCharsetFromTextEncoding_MS_936()
966 check( "RTL_TEXTENCODING_MS_936", RTL_TEXTENCODING_MS_936
);
968 // ----------------------------------------
969 void UnixCharsetFromTextEncoding_MS_949()
971 check( "RTL_TEXTENCODING_MS_949", RTL_TEXTENCODING_MS_949
);
973 // ----------------------------------------
974 void UnixCharsetFromTextEncoding_MS_950()
976 check( "RTL_TEXTENCODING_MS_950", RTL_TEXTENCODING_MS_950
);
978 // ----------------------------------------
979 void UnixCharsetFromTextEncoding_SHIFT_JIS()
981 check( "RTL_TEXTENCODING_SHIFT_JIS", RTL_TEXTENCODING_SHIFT_JIS
);
983 // ----------------------------------------
984 void UnixCharsetFromTextEncoding_GB_2312()
986 check( "RTL_TEXTENCODING_GB_2312", RTL_TEXTENCODING_GB_2312
);
988 // ----------------------------------------
989 void UnixCharsetFromTextEncoding_GBT_12345()
991 check( "RTL_TEXTENCODING_GBT_12345", RTL_TEXTENCODING_GBT_12345
);
993 // ----------------------------------------
994 void UnixCharsetFromTextEncoding_GBK()
996 check( "RTL_TEXTENCODING_GBK", RTL_TEXTENCODING_GBK
);
998 // ----------------------------------------
999 void UnixCharsetFromTextEncoding_BIG5()
1001 check( "RTL_TEXTENCODING_BIG5", RTL_TEXTENCODING_BIG5
);
1003 // ----------------------------------------
1004 void UnixCharsetFromTextEncoding_EUC_JP()
1006 check( "RTL_TEXTENCODING_EUC_JP", RTL_TEXTENCODING_EUC_JP
);
1008 // ----------------------------------------
1009 void UnixCharsetFromTextEncoding_EUC_CN()
1011 check( "RTL_TEXTENCODING_EUC_CN", RTL_TEXTENCODING_EUC_CN
);
1013 // ----------------------------------------
1014 void UnixCharsetFromTextEncoding_EUC_TW()
1016 check( "RTL_TEXTENCODING_EUC_TW", RTL_TEXTENCODING_EUC_TW
);
1018 // ----------------------------------------
1019 void UnixCharsetFromTextEncoding_ISO_2022_JP()
1021 check( "RTL_TEXTENCODING_ISO_2022_JP", RTL_TEXTENCODING_ISO_2022_JP
);
1023 // ----------------------------------------
1024 void UnixCharsetFromTextEncoding_ISO_2022_CN()
1026 check( "RTL_TEXTENCODING_ISO_2022_CN", RTL_TEXTENCODING_ISO_2022_CN
);
1028 // ----------------------------------------
1029 void UnixCharsetFromTextEncoding_KOI8_R()
1031 check( "RTL_TEXTENCODING_KOI8_R", RTL_TEXTENCODING_KOI8_R
);
1033 // ----------------------------------------
1034 void UnixCharsetFromTextEncoding_UTF7()
1036 check( "RTL_TEXTENCODING_UTF7", RTL_TEXTENCODING_UTF7
);
1038 // ----------------------------------------
1039 void UnixCharsetFromTextEncoding_UTF8()
1041 check( "RTL_TEXTENCODING_UTF8", RTL_TEXTENCODING_UTF8
);
1043 // ----------------------------------------
1044 void UnixCharsetFromTextEncoding_ISO_8859_10()
1046 check( "RTL_TEXTENCODING_ISO_8859_10", RTL_TEXTENCODING_ISO_8859_10
);
1048 // ----------------------------------------
1049 void UnixCharsetFromTextEncoding_ISO_8859_13()
1051 check( "RTL_TEXTENCODING_ISO_8859_13", RTL_TEXTENCODING_ISO_8859_13
);
1053 // ----------------------------------------
1054 void UnixCharsetFromTextEncoding_EUC_KR()
1056 check( "RTL_TEXTENCODING_EUC_KR", RTL_TEXTENCODING_EUC_KR
);
1058 // ----------------------------------------
1059 void UnixCharsetFromTextEncoding_ISO_2022_KR()
1061 check( "RTL_TEXTENCODING_ISO_2022_KR", RTL_TEXTENCODING_ISO_2022_KR
);
1063 // ----------------------------------------
1064 void UnixCharsetFromTextEncoding_JIS_X_0201()
1066 check( "RTL_TEXTENCODING_JIS_X_0201", RTL_TEXTENCODING_JIS_X_0201
);
1068 // ----------------------------------------
1069 void UnixCharsetFromTextEncoding_JIS_X_0208()
1071 check( "RTL_TEXTENCODING_JIS_X_0208", RTL_TEXTENCODING_JIS_X_0208
);
1073 // ----------------------------------------
1074 void UnixCharsetFromTextEncoding_JIS_X_0212()
1076 check( "RTL_TEXTENCODING_JIS_X_0212", RTL_TEXTENCODING_JIS_X_0212
);
1078 // ----------------------------------------
1079 void UnixCharsetFromTextEncoding_MS_1361()
1081 check( "RTL_TEXTENCODING_MS_1361", RTL_TEXTENCODING_MS_1361
);
1083 // ----------------------------------------
1084 void UnixCharsetFromTextEncoding_GB_18030()
1086 check( "RTL_TEXTENCODING_GB_18030", RTL_TEXTENCODING_GB_18030
);
1088 // ----------------------------------------
1089 void UnixCharsetFromTextEncoding_BIG5_HKSCS()
1091 check( "RTL_TEXTENCODING_BIG5_HKSCS", RTL_TEXTENCODING_BIG5_HKSCS
);
1093 // ----------------------------------------
1094 void UnixCharsetFromTextEncoding_TIS_620()
1096 check( "RTL_TEXTENCODING_TIS_620", RTL_TEXTENCODING_TIS_620
);
1098 // ----------------------------------------
1099 void UnixCharsetFromTextEncoding_KOI8_U()
1101 check( "RTL_TEXTENCODING_KOI8_U", RTL_TEXTENCODING_KOI8_U
);
1103 // ----------------------------------------
1104 void UnixCharsetFromTextEncoding_ISCII_DEVANAGARI()
1106 check( "RTL_TEXTENCODING_ISCII_DEVANAGARI", RTL_TEXTENCODING_ISCII_DEVANAGARI
);
1108 // ----------------------------------------
1109 void UnixCharsetFromTextEncoding_JAVA_UTF8()
1111 check( "RTL_TEXTENCODING_JAVA_UTF8", RTL_TEXTENCODING_JAVA_UTF8
);
1113 // ----------------------------------------
1115 CPPUNIT_TEST_SUITE( getBestUnix
);
1116 CPPUNIT_TEST( UnixCharsetFromTextEncoding_MS_1252
);
1117 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_ROMAN
);
1118 CPPUNIT_TEST( UnixCharsetFromTextEncoding_IBM_437
);
1119 CPPUNIT_TEST( UnixCharsetFromTextEncoding_IBM_850
);
1120 CPPUNIT_TEST( UnixCharsetFromTextEncoding_IBM_860
);
1121 CPPUNIT_TEST( UnixCharsetFromTextEncoding_IBM_861
);
1122 CPPUNIT_TEST( UnixCharsetFromTextEncoding_IBM_863
);
1123 CPPUNIT_TEST( UnixCharsetFromTextEncoding_IBM_865
);
1125 CPPUNIT_TEST( UnixCharsetFromTextEncoding_SYMBOL
);
1126 CPPUNIT_TEST( UnixCharsetFromTextEncoding_ASCII_US
);
1127 CPPUNIT_TEST( UnixCharsetFromTextEncoding_ISO_8859_1
);
1128 CPPUNIT_TEST( UnixCharsetFromTextEncoding_ISO_8859_2
);
1129 CPPUNIT_TEST( UnixCharsetFromTextEncoding_ISO_8859_3
);
1130 CPPUNIT_TEST( UnixCharsetFromTextEncoding_ISO_8859_4
);
1131 CPPUNIT_TEST( UnixCharsetFromTextEncoding_ISO_8859_5
);
1132 CPPUNIT_TEST( UnixCharsetFromTextEncoding_ISO_8859_6
);
1133 CPPUNIT_TEST( UnixCharsetFromTextEncoding_ISO_8859_7
);
1134 CPPUNIT_TEST( UnixCharsetFromTextEncoding_ISO_8859_8
);
1135 CPPUNIT_TEST( UnixCharsetFromTextEncoding_ISO_8859_9
);
1136 CPPUNIT_TEST( UnixCharsetFromTextEncoding_ISO_8859_14
);
1137 CPPUNIT_TEST( UnixCharsetFromTextEncoding_ISO_8859_15
);
1138 CPPUNIT_TEST( UnixCharsetFromTextEncoding_IBM_737
);
1139 CPPUNIT_TEST( UnixCharsetFromTextEncoding_IBM_775
);
1140 CPPUNIT_TEST( UnixCharsetFromTextEncoding_IBM_852
);
1141 CPPUNIT_TEST( UnixCharsetFromTextEncoding_IBM_855
);
1142 CPPUNIT_TEST( UnixCharsetFromTextEncoding_IBM_857
);
1143 CPPUNIT_TEST( UnixCharsetFromTextEncoding_IBM_862
);
1144 CPPUNIT_TEST( UnixCharsetFromTextEncoding_IBM_864
);
1145 CPPUNIT_TEST( UnixCharsetFromTextEncoding_IBM_866
);
1146 CPPUNIT_TEST( UnixCharsetFromTextEncoding_IBM_869
);
1147 CPPUNIT_TEST( UnixCharsetFromTextEncoding_MS_874
);
1148 CPPUNIT_TEST( UnixCharsetFromTextEncoding_MS_1250
);
1149 CPPUNIT_TEST( UnixCharsetFromTextEncoding_MS_1251
);
1150 CPPUNIT_TEST( UnixCharsetFromTextEncoding_MS_1253
);
1151 CPPUNIT_TEST( UnixCharsetFromTextEncoding_MS_1254
);
1152 CPPUNIT_TEST( UnixCharsetFromTextEncoding_MS_1255
);
1153 CPPUNIT_TEST( UnixCharsetFromTextEncoding_MS_1256
);
1154 CPPUNIT_TEST( UnixCharsetFromTextEncoding_MS_1257
);
1155 CPPUNIT_TEST( UnixCharsetFromTextEncoding_MS_1258
);
1156 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_ARABIC
);
1157 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_CENTEURO
);
1158 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_CROATIAN
);
1159 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_CYRILLIC
);
1160 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_DEVANAGARI
);
1161 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_FARSI
);
1162 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_GREEK
);
1163 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_GUJARATI
);
1164 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_GURMUKHI
);
1165 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_HEBREW
);
1166 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_ICELAND
);
1167 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_ROMANIAN
);
1168 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_THAI
);
1169 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_TURKISH
);
1170 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_UKRAINIAN
);
1171 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_CHINSIMP
);
1172 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_CHINTRAD
);
1173 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_JAPANESE
);
1174 CPPUNIT_TEST( UnixCharsetFromTextEncoding_APPLE_KOREAN
);
1175 CPPUNIT_TEST( UnixCharsetFromTextEncoding_MS_932
);
1176 CPPUNIT_TEST( UnixCharsetFromTextEncoding_MS_936
);
1177 CPPUNIT_TEST( UnixCharsetFromTextEncoding_MS_949
);
1178 CPPUNIT_TEST( UnixCharsetFromTextEncoding_MS_950
);
1179 CPPUNIT_TEST( UnixCharsetFromTextEncoding_SHIFT_JIS
);
1180 CPPUNIT_TEST( UnixCharsetFromTextEncoding_GB_2312
);
1181 CPPUNIT_TEST( UnixCharsetFromTextEncoding_GBT_12345
);
1182 CPPUNIT_TEST( UnixCharsetFromTextEncoding_GBK
);
1183 CPPUNIT_TEST( UnixCharsetFromTextEncoding_BIG5
);
1184 CPPUNIT_TEST( UnixCharsetFromTextEncoding_EUC_JP
);
1185 CPPUNIT_TEST( UnixCharsetFromTextEncoding_EUC_CN
);
1186 CPPUNIT_TEST( UnixCharsetFromTextEncoding_EUC_TW
);
1187 CPPUNIT_TEST( UnixCharsetFromTextEncoding_ISO_2022_JP
);
1188 CPPUNIT_TEST( UnixCharsetFromTextEncoding_ISO_2022_CN
);
1189 CPPUNIT_TEST( UnixCharsetFromTextEncoding_KOI8_R
);
1190 CPPUNIT_TEST( UnixCharsetFromTextEncoding_UTF7
);
1191 CPPUNIT_TEST( UnixCharsetFromTextEncoding_UTF8
);
1192 CPPUNIT_TEST( UnixCharsetFromTextEncoding_ISO_8859_10
);
1193 CPPUNIT_TEST( UnixCharsetFromTextEncoding_ISO_8859_13
);
1194 CPPUNIT_TEST( UnixCharsetFromTextEncoding_EUC_KR
);
1195 CPPUNIT_TEST( UnixCharsetFromTextEncoding_ISO_2022_KR
);
1196 CPPUNIT_TEST( UnixCharsetFromTextEncoding_JIS_X_0201
);
1197 CPPUNIT_TEST( UnixCharsetFromTextEncoding_JIS_X_0208
);
1198 CPPUNIT_TEST( UnixCharsetFromTextEncoding_JIS_X_0212
);
1199 CPPUNIT_TEST( UnixCharsetFromTextEncoding_MS_1361
);
1200 CPPUNIT_TEST( UnixCharsetFromTextEncoding_GB_18030
);
1201 CPPUNIT_TEST( UnixCharsetFromTextEncoding_BIG5_HKSCS
);
1202 CPPUNIT_TEST( UnixCharsetFromTextEncoding_TIS_620
);
1203 CPPUNIT_TEST( UnixCharsetFromTextEncoding_KOI8_U
);
1204 CPPUNIT_TEST( UnixCharsetFromTextEncoding_ISCII_DEVANAGARI
);
1205 CPPUNIT_TEST( UnixCharsetFromTextEncoding_JAVA_UTF8
);
1207 CPPUNIT_TEST_SUITE_END( );
1210 // -----------------------------------------------------------------------------
1213 class getBestWindows
: public CppUnit::TestFixture
1220 void check( const sal_Char
* _pRTL_TEXTENCODING
, rtl_TextEncoding _aCurrentEncode
)
1222 const sal_uInt8 nCharSet
= rtl_getBestWindowsCharsetFromTextEncoding( _aCurrentEncode
);
1225 t_print("rtl_getBestWindowsCharsetFromTextEncoding(%s) (%d) doesn't seem to exist.\n\n", _pRTL_TEXTENCODING
, _aCurrentEncode
);
1229 t_print(T_VERBOSE
, "'%s' is charset: '%d'\n", _pRTL_TEXTENCODING
, nCharSet
);
1231 rtl_TextEncoding eTextEnc
= rtl_getTextEncodingFromWindowsCharset( nCharSet
);
1232 if (_aCurrentEncode
!= eTextEnc
&&
1233 eTextEnc
!= RTL_TEXTENCODING_DONTKNOW
)
1235 t_print("rtl_getBestUnixCharsetFromTextEncoding(%s) is charset: %d\n", _pRTL_TEXTENCODING
, nCharSet
);
1236 t_print("rtl_getTextEncodingFromWindowsCharset() differ: %s %d -> %d\n\n", _pRTL_TEXTENCODING
, _aCurrentEncode
, eTextEnc
);
1238 // rtl::OString sError = "getTextEncodingFromWindowsCharset(";
1239 // sError += rtl::OString::valueOf(nCharSet);
1240 // sError += ") returns nul.";
1242 // CPPUNIT_ASSERT_MESSAGE(sError.getStr(), eTextEnc != RTL_TEXTENCODING_DONTKNOW);
1243 // CPPUNIT_ASSERT_MESSAGE("Does not realize itself", _aCurrentEncode == eTextEnc );
1247 // ----------------------------------------
1248 void WindowsCharsetFromTextEncoding_MS_1252()
1250 check( "RTL_TEXTENCODING_MS_1252", RTL_TEXTENCODING_MS_1252
);
1252 // ----------------------------------------
1253 void WindowsCharsetFromTextEncoding_APPLE_ROMAN()
1255 check( "RTL_TEXTENCODING_APPLE_ROMAN", RTL_TEXTENCODING_APPLE_ROMAN
);
1257 // ----------------------------------------
1258 void WindowsCharsetFromTextEncoding_IBM_437()
1260 check( "RTL_TEXTENCODING_IBM_437", RTL_TEXTENCODING_IBM_437
);
1262 // ----------------------------------------
1263 void WindowsCharsetFromTextEncoding_IBM_850()
1265 check( "RTL_TEXTENCODING_IBM_850", RTL_TEXTENCODING_IBM_850
);
1267 // ----------------------------------------
1268 void WindowsCharsetFromTextEncoding_IBM_860()
1270 check( "RTL_TEXTENCODING_IBM_860", RTL_TEXTENCODING_IBM_860
);
1272 // ----------------------------------------
1273 void WindowsCharsetFromTextEncoding_IBM_861()
1275 check( "RTL_TEXTENCODING_IBM_861", RTL_TEXTENCODING_IBM_861
);
1277 // ----------------------------------------
1278 void WindowsCharsetFromTextEncoding_IBM_863()
1280 check( "RTL_TEXTENCODING_IBM_863", RTL_TEXTENCODING_IBM_863
);
1282 // ----------------------------------------
1283 void WindowsCharsetFromTextEncoding_IBM_865()
1285 check( "RTL_TEXTENCODING_IBM_865", RTL_TEXTENCODING_IBM_865
);
1287 // ----------------------------------------
1288 void WindowsCharsetFromTextEncoding_SYMBOL()
1290 check( "RTL_TEXTENCODING_SYMBOL", RTL_TEXTENCODING_SYMBOL
);
1292 // ----------------------------------------
1293 void WindowsCharsetFromTextEncoding_ASCII_US()
1295 check( "RTL_TEXTENCODING_ASCII_US", RTL_TEXTENCODING_ASCII_US
);
1297 // ----------------------------------------
1298 void WindowsCharsetFromTextEncoding_ISO_8859_1()
1300 check( "RTL_TEXTENCODING_ISO_8859_1", RTL_TEXTENCODING_ISO_8859_1
);
1302 // ----------------------------------------
1303 void WindowsCharsetFromTextEncoding_ISO_8859_2()
1305 check( "RTL_TEXTENCODING_ISO_8859_2", RTL_TEXTENCODING_ISO_8859_2
);
1307 // ----------------------------------------
1308 void WindowsCharsetFromTextEncoding_ISO_8859_3()
1310 check( "RTL_TEXTENCODING_ISO_8859_3", RTL_TEXTENCODING_ISO_8859_3
);
1312 // ----------------------------------------
1313 void WindowsCharsetFromTextEncoding_ISO_8859_4()
1315 check( "RTL_TEXTENCODING_ISO_8859_4", RTL_TEXTENCODING_ISO_8859_4
);
1317 // ----------------------------------------
1318 void WindowsCharsetFromTextEncoding_ISO_8859_5()
1320 check( "RTL_TEXTENCODING_ISO_8859_5", RTL_TEXTENCODING_ISO_8859_5
);
1322 // ----------------------------------------
1323 void WindowsCharsetFromTextEncoding_ISO_8859_6()
1325 check( "RTL_TEXTENCODING_ISO_8859_6", RTL_TEXTENCODING_ISO_8859_6
);
1327 // ----------------------------------------
1328 void WindowsCharsetFromTextEncoding_ISO_8859_7()
1330 check( "RTL_TEXTENCODING_ISO_8859_7", RTL_TEXTENCODING_ISO_8859_7
);
1332 // ----------------------------------------
1333 void WindowsCharsetFromTextEncoding_ISO_8859_8()
1335 check( "RTL_TEXTENCODING_ISO_8859_8", RTL_TEXTENCODING_ISO_8859_8
);
1337 // ----------------------------------------
1338 void WindowsCharsetFromTextEncoding_ISO_8859_9()
1340 check( "RTL_TEXTENCODING_ISO_8859_9", RTL_TEXTENCODING_ISO_8859_9
);
1342 // ----------------------------------------
1343 void WindowsCharsetFromTextEncoding_ISO_8859_14()
1345 check( "RTL_TEXTENCODING_ISO_8859_14", RTL_TEXTENCODING_ISO_8859_14
);
1347 // ----------------------------------------
1348 void WindowsCharsetFromTextEncoding_ISO_8859_15()
1350 check( "RTL_TEXTENCODING_ISO_8859_15", RTL_TEXTENCODING_ISO_8859_15
);
1352 // ----------------------------------------
1353 void WindowsCharsetFromTextEncoding_IBM_737()
1355 check( "RTL_TEXTENCODING_IBM_737", RTL_TEXTENCODING_IBM_737
);
1357 // ----------------------------------------
1358 void WindowsCharsetFromTextEncoding_IBM_775()
1360 check( "RTL_TEXTENCODING_IBM_775", RTL_TEXTENCODING_IBM_775
);
1362 // ----------------------------------------
1363 void WindowsCharsetFromTextEncoding_IBM_852()
1365 check( "RTL_TEXTENCODING_IBM_852", RTL_TEXTENCODING_IBM_852
);
1367 // ----------------------------------------
1368 void WindowsCharsetFromTextEncoding_IBM_855()
1370 check( "RTL_TEXTENCODING_IBM_855", RTL_TEXTENCODING_IBM_855
);
1372 // ----------------------------------------
1373 void WindowsCharsetFromTextEncoding_IBM_857()
1375 check( "RTL_TEXTENCODING_IBM_857", RTL_TEXTENCODING_IBM_857
);
1377 // ----------------------------------------
1378 void WindowsCharsetFromTextEncoding_IBM_862()
1380 check( "RTL_TEXTENCODING_IBM_862", RTL_TEXTENCODING_IBM_862
);
1382 // ----------------------------------------
1383 void WindowsCharsetFromTextEncoding_IBM_864()
1385 check( "RTL_TEXTENCODING_IBM_864", RTL_TEXTENCODING_IBM_864
);
1387 // ----------------------------------------
1388 void WindowsCharsetFromTextEncoding_IBM_866()
1390 check( "RTL_TEXTENCODING_IBM_866", RTL_TEXTENCODING_IBM_866
);
1392 // ----------------------------------------
1393 void WindowsCharsetFromTextEncoding_IBM_869()
1395 check( "RTL_TEXTENCODING_IBM_869", RTL_TEXTENCODING_IBM_869
);
1397 // ----------------------------------------
1398 void WindowsCharsetFromTextEncoding_MS_874()
1400 check( "RTL_TEXTENCODING_MS_874", RTL_TEXTENCODING_MS_874
);
1402 // ----------------------------------------
1403 void WindowsCharsetFromTextEncoding_MS_1250()
1405 check( "RTL_TEXTENCODING_MS_1250", RTL_TEXTENCODING_MS_1250
);
1407 // ----------------------------------------
1408 void WindowsCharsetFromTextEncoding_MS_1251()
1410 check( "RTL_TEXTENCODING_MS_1251", RTL_TEXTENCODING_MS_1251
);
1412 // ----------------------------------------
1413 void WindowsCharsetFromTextEncoding_MS_1253()
1415 check( "RTL_TEXTENCODING_MS_1253", RTL_TEXTENCODING_MS_1253
);
1417 // ----------------------------------------
1418 void WindowsCharsetFromTextEncoding_MS_1254()
1420 check( "RTL_TEXTENCODING_MS_1254", RTL_TEXTENCODING_MS_1254
);
1422 // ----------------------------------------
1423 void WindowsCharsetFromTextEncoding_MS_1255()
1425 check( "RTL_TEXTENCODING_MS_1255", RTL_TEXTENCODING_MS_1255
);
1427 // ----------------------------------------
1428 void WindowsCharsetFromTextEncoding_MS_1256()
1430 check( "RTL_TEXTENCODING_MS_1256", RTL_TEXTENCODING_MS_1256
);
1432 // ----------------------------------------
1433 void WindowsCharsetFromTextEncoding_MS_1257()
1435 check( "RTL_TEXTENCODING_MS_1257", RTL_TEXTENCODING_MS_1257
);
1437 // ----------------------------------------
1438 void WindowsCharsetFromTextEncoding_MS_1258()
1440 check( "RTL_TEXTENCODING_MS_1258", RTL_TEXTENCODING_MS_1258
);
1442 // ----------------------------------------
1443 void WindowsCharsetFromTextEncoding_APPLE_ARABIC()
1445 check( "RTL_TEXTENCODING_APPLE_ARABIC", RTL_TEXTENCODING_APPLE_ARABIC
);
1447 // ----------------------------------------
1448 void WindowsCharsetFromTextEncoding_APPLE_CENTEURO()
1450 check( "RTL_TEXTENCODING_APPLE_CENTEURO", RTL_TEXTENCODING_APPLE_CENTEURO
);
1452 // ----------------------------------------
1453 void WindowsCharsetFromTextEncoding_APPLE_CROATIAN()
1455 check( "RTL_TEXTENCODING_APPLE_CROATIAN", RTL_TEXTENCODING_APPLE_CROATIAN
);
1457 // ----------------------------------------
1458 void WindowsCharsetFromTextEncoding_APPLE_CYRILLIC()
1460 check( "RTL_TEXTENCODING_APPLE_CYRILLIC", RTL_TEXTENCODING_APPLE_CYRILLIC
);
1462 // ----------------------------------------
1463 void WindowsCharsetFromTextEncoding_APPLE_DEVANAGARI()
1465 check( "RTL_TEXTENCODING_APPLE_DEVANAGARI", RTL_TEXTENCODING_APPLE_DEVANAGARI
);
1467 // ----------------------------------------
1468 void WindowsCharsetFromTextEncoding_APPLE_FARSI()
1470 check( "RTL_TEXTENCODING_APPLE_FARSI", RTL_TEXTENCODING_APPLE_FARSI
);
1472 // ----------------------------------------
1473 void WindowsCharsetFromTextEncoding_APPLE_GREEK()
1475 check( "RTL_TEXTENCODING_APPLE_GREEK", RTL_TEXTENCODING_APPLE_GREEK
);
1477 // ----------------------------------------
1478 void WindowsCharsetFromTextEncoding_APPLE_GUJARATI()
1480 check( "RTL_TEXTENCODING_APPLE_GUJARATI", RTL_TEXTENCODING_APPLE_GUJARATI
);
1482 // ----------------------------------------
1483 void WindowsCharsetFromTextEncoding_APPLE_GURMUKHI()
1485 check( "RTL_TEXTENCODING_APPLE_GURMUKHI", RTL_TEXTENCODING_APPLE_GURMUKHI
);
1487 // ----------------------------------------
1488 void WindowsCharsetFromTextEncoding_APPLE_HEBREW()
1490 check( "RTL_TEXTENCODING_APPLE_HEBREW", RTL_TEXTENCODING_APPLE_HEBREW
);
1492 // ----------------------------------------
1493 void WindowsCharsetFromTextEncoding_APPLE_ICELAND()
1495 check( "RTL_TEXTENCODING_APPLE_ICELAND", RTL_TEXTENCODING_APPLE_ICELAND
);
1497 // ----------------------------------------
1498 void WindowsCharsetFromTextEncoding_APPLE_ROMANIAN()
1500 check( "RTL_TEXTENCODING_APPLE_ROMANIAN", RTL_TEXTENCODING_APPLE_ROMANIAN
);
1502 // ----------------------------------------
1503 void WindowsCharsetFromTextEncoding_APPLE_THAI()
1505 check( "RTL_TEXTENCODING_APPLE_THAI", RTL_TEXTENCODING_APPLE_THAI
);
1507 // ----------------------------------------
1508 void WindowsCharsetFromTextEncoding_APPLE_TURKISH()
1510 check( "RTL_TEXTENCODING_APPLE_TURKISH", RTL_TEXTENCODING_APPLE_TURKISH
);
1512 // ----------------------------------------
1513 void WindowsCharsetFromTextEncoding_APPLE_UKRAINIAN()
1515 check( "RTL_TEXTENCODING_APPLE_UKRAINIAN", RTL_TEXTENCODING_APPLE_UKRAINIAN
);
1517 // ----------------------------------------
1518 void WindowsCharsetFromTextEncoding_APPLE_CHINSIMP()
1520 check( "RTL_TEXTENCODING_APPLE_CHINSIMP", RTL_TEXTENCODING_APPLE_CHINSIMP
);
1522 // ----------------------------------------
1523 void WindowsCharsetFromTextEncoding_APPLE_CHINTRAD()
1525 check( "RTL_TEXTENCODING_APPLE_CHINTRAD", RTL_TEXTENCODING_APPLE_CHINTRAD
);
1527 // ----------------------------------------
1528 void WindowsCharsetFromTextEncoding_APPLE_JAPANESE()
1530 check( "RTL_TEXTENCODING_APPLE_JAPANESE", RTL_TEXTENCODING_APPLE_JAPANESE
);
1532 // ----------------------------------------
1533 void WindowsCharsetFromTextEncoding_APPLE_KOREAN()
1535 check( "RTL_TEXTENCODING_APPLE_KOREAN", RTL_TEXTENCODING_APPLE_KOREAN
);
1537 // ----------------------------------------
1538 void WindowsCharsetFromTextEncoding_MS_932()
1540 check( "RTL_TEXTENCODING_MS_932", RTL_TEXTENCODING_MS_932
);
1542 // ----------------------------------------
1543 void WindowsCharsetFromTextEncoding_MS_936()
1545 check( "RTL_TEXTENCODING_MS_936", RTL_TEXTENCODING_MS_936
);
1547 // ----------------------------------------
1548 void WindowsCharsetFromTextEncoding_MS_949()
1550 check( "RTL_TEXTENCODING_MS_949", RTL_TEXTENCODING_MS_949
);
1552 // ----------------------------------------
1553 void WindowsCharsetFromTextEncoding_MS_950()
1555 check( "RTL_TEXTENCODING_MS_950", RTL_TEXTENCODING_MS_950
);
1557 // ----------------------------------------
1558 void WindowsCharsetFromTextEncoding_SHIFT_JIS()
1560 check( "RTL_TEXTENCODING_SHIFT_JIS", RTL_TEXTENCODING_SHIFT_JIS
);
1562 // ----------------------------------------
1563 void WindowsCharsetFromTextEncoding_GB_2312()
1565 check( "RTL_TEXTENCODING_GB_2312", RTL_TEXTENCODING_GB_2312
);
1567 // ----------------------------------------
1568 void WindowsCharsetFromTextEncoding_GBT_12345()
1570 check( "RTL_TEXTENCODING_GBT_12345", RTL_TEXTENCODING_GBT_12345
);
1572 // ----------------------------------------
1573 void WindowsCharsetFromTextEncoding_GBK()
1575 check( "RTL_TEXTENCODING_GBK", RTL_TEXTENCODING_GBK
);
1577 // ----------------------------------------
1578 void WindowsCharsetFromTextEncoding_BIG5()
1580 check( "RTL_TEXTENCODING_BIG5", RTL_TEXTENCODING_BIG5
);
1582 // ----------------------------------------
1583 void WindowsCharsetFromTextEncoding_EUC_JP()
1585 check( "RTL_TEXTENCODING_EUC_JP", RTL_TEXTENCODING_EUC_JP
);
1587 // ----------------------------------------
1588 void WindowsCharsetFromTextEncoding_EUC_CN()
1590 check( "RTL_TEXTENCODING_EUC_CN", RTL_TEXTENCODING_EUC_CN
);
1592 // ----------------------------------------
1593 void WindowsCharsetFromTextEncoding_EUC_TW()
1595 check( "RTL_TEXTENCODING_EUC_TW", RTL_TEXTENCODING_EUC_TW
);
1597 // ----------------------------------------
1598 void WindowsCharsetFromTextEncoding_ISO_2022_JP()
1600 check( "RTL_TEXTENCODING_ISO_2022_JP", RTL_TEXTENCODING_ISO_2022_JP
);
1602 // ----------------------------------------
1603 void WindowsCharsetFromTextEncoding_ISO_2022_CN()
1605 check( "RTL_TEXTENCODING_ISO_2022_CN", RTL_TEXTENCODING_ISO_2022_CN
);
1607 // ----------------------------------------
1608 void WindowsCharsetFromTextEncoding_KOI8_R()
1610 check( "RTL_TEXTENCODING_KOI8_R", RTL_TEXTENCODING_KOI8_R
);
1612 // ----------------------------------------
1613 void WindowsCharsetFromTextEncoding_UTF7()
1615 check( "RTL_TEXTENCODING_UTF7", RTL_TEXTENCODING_UTF7
);
1617 // ----------------------------------------
1618 void WindowsCharsetFromTextEncoding_UTF8()
1620 check( "RTL_TEXTENCODING_UTF8", RTL_TEXTENCODING_UTF8
);
1622 // ----------------------------------------
1623 void WindowsCharsetFromTextEncoding_ISO_8859_10()
1625 check( "RTL_TEXTENCODING_ISO_8859_10", RTL_TEXTENCODING_ISO_8859_10
);
1627 // ----------------------------------------
1628 void WindowsCharsetFromTextEncoding_ISO_8859_13()
1630 check( "RTL_TEXTENCODING_ISO_8859_13", RTL_TEXTENCODING_ISO_8859_13
);
1632 // ----------------------------------------
1633 void WindowsCharsetFromTextEncoding_EUC_KR()
1635 check( "RTL_TEXTENCODING_EUC_KR", RTL_TEXTENCODING_EUC_KR
);
1637 // ----------------------------------------
1638 void WindowsCharsetFromTextEncoding_ISO_2022_KR()
1640 check( "RTL_TEXTENCODING_ISO_2022_KR", RTL_TEXTENCODING_ISO_2022_KR
);
1642 // ----------------------------------------
1643 void WindowsCharsetFromTextEncoding_JIS_X_0201()
1645 check( "RTL_TEXTENCODING_JIS_X_0201", RTL_TEXTENCODING_JIS_X_0201
);
1647 // ----------------------------------------
1648 void WindowsCharsetFromTextEncoding_JIS_X_0208()
1650 check( "RTL_TEXTENCODING_JIS_X_0208", RTL_TEXTENCODING_JIS_X_0208
);
1652 // ----------------------------------------
1653 void WindowsCharsetFromTextEncoding_JIS_X_0212()
1655 check( "RTL_TEXTENCODING_JIS_X_0212", RTL_TEXTENCODING_JIS_X_0212
);
1657 // ----------------------------------------
1658 void WindowsCharsetFromTextEncoding_MS_1361()
1660 check( "RTL_TEXTENCODING_MS_1361", RTL_TEXTENCODING_MS_1361
);
1662 // ----------------------------------------
1663 void WindowsCharsetFromTextEncoding_GB_18030()
1665 check( "RTL_TEXTENCODING_GB_18030", RTL_TEXTENCODING_GB_18030
);
1667 // ----------------------------------------
1668 void WindowsCharsetFromTextEncoding_BIG5_HKSCS()
1670 check( "RTL_TEXTENCODING_BIG5_HKSCS", RTL_TEXTENCODING_BIG5_HKSCS
);
1672 // ----------------------------------------
1673 void WindowsCharsetFromTextEncoding_TIS_620()
1675 check( "RTL_TEXTENCODING_TIS_620", RTL_TEXTENCODING_TIS_620
);
1677 // ----------------------------------------
1678 void WindowsCharsetFromTextEncoding_KOI8_U()
1680 check( "RTL_TEXTENCODING_KOI8_U", RTL_TEXTENCODING_KOI8_U
);
1682 // ----------------------------------------
1683 void WindowsCharsetFromTextEncoding_ISCII_DEVANAGARI()
1685 check( "RTL_TEXTENCODING_ISCII_DEVANAGARI", RTL_TEXTENCODING_ISCII_DEVANAGARI
);
1687 // ----------------------------------------
1688 void WindowsCharsetFromTextEncoding_JAVA_UTF8()
1690 check( "RTL_TEXTENCODING_JAVA_UTF8", RTL_TEXTENCODING_JAVA_UTF8
);
1692 // ----------------------------------------
1694 CPPUNIT_TEST_SUITE( getBestWindows
);
1695 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_MS_1252
);
1696 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_ROMAN
);
1697 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_IBM_437
);
1698 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_IBM_850
);
1699 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_IBM_860
);
1700 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_IBM_861
);
1701 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_IBM_863
);
1702 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_IBM_865
);
1703 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_SYMBOL
);
1704 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_ASCII_US
);
1705 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_ISO_8859_1
);
1706 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_ISO_8859_2
);
1707 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_ISO_8859_3
);
1708 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_ISO_8859_4
);
1709 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_ISO_8859_5
);
1710 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_ISO_8859_6
);
1711 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_ISO_8859_7
);
1712 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_ISO_8859_8
);
1713 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_ISO_8859_9
);
1714 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_ISO_8859_14
);
1715 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_ISO_8859_15
);
1716 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_IBM_737
);
1717 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_IBM_775
);
1718 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_IBM_852
);
1719 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_IBM_855
);
1720 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_IBM_857
);
1721 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_IBM_862
);
1722 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_IBM_864
);
1723 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_IBM_866
);
1724 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_IBM_869
);
1725 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_MS_874
);
1726 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_MS_1250
);
1727 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_MS_1251
);
1728 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_MS_1253
);
1729 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_MS_1254
);
1730 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_MS_1255
);
1731 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_MS_1256
);
1732 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_MS_1257
);
1733 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_MS_1258
);
1734 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_ARABIC
);
1735 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_CENTEURO
);
1736 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_CROATIAN
);
1737 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_CYRILLIC
);
1738 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_DEVANAGARI
);
1739 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_FARSI
);
1740 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_GREEK
);
1741 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_GUJARATI
);
1742 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_GURMUKHI
);
1743 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_HEBREW
);
1744 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_ICELAND
);
1745 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_ROMANIAN
);
1746 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_THAI
);
1747 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_TURKISH
);
1748 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_UKRAINIAN
);
1749 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_CHINSIMP
);
1750 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_CHINTRAD
);
1751 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_JAPANESE
);
1752 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_APPLE_KOREAN
);
1753 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_MS_932
);
1754 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_MS_936
);
1755 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_MS_949
);
1756 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_MS_950
);
1757 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_SHIFT_JIS
);
1758 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_GB_2312
);
1759 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_GBT_12345
);
1760 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_GBK
);
1761 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_BIG5
);
1762 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_EUC_JP
);
1763 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_EUC_CN
);
1764 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_EUC_TW
);
1765 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_ISO_2022_JP
);
1766 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_ISO_2022_CN
);
1767 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_KOI8_R
);
1768 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_UTF7
);
1769 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_UTF8
);
1770 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_ISO_8859_10
);
1771 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_ISO_8859_13
);
1772 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_EUC_KR
);
1773 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_ISO_2022_KR
);
1774 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_JIS_X_0201
);
1775 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_JIS_X_0208
);
1776 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_JIS_X_0212
);
1777 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_MS_1361
);
1778 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_GB_18030
);
1779 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_BIG5_HKSCS
);
1780 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_TIS_620
);
1781 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_KOI8_U
);
1782 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_ISCII_DEVANAGARI
);
1783 CPPUNIT_TEST( WindowsCharsetFromTextEncoding_JAVA_UTF8
);
1785 CPPUNIT_TEST_SUITE_END( );
1787 class getTextEncodingInfo
: public CppUnit::TestFixture
1790 // initialise your test code values here.
1799 // not implemented encoding test
1800 void getTextEncodingInfo_001()
1802 rtl_TextEncodingInfo aInfo1
, aInfo2
, aInfo3
, aInfo4
, aInfo5
;
1803 aInfo1
.StructSize
= 4;
1805 sal_Bool bRes1
= rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_ARABIC
, &aInfo1
);
1807 sal_Bool bRes11
= rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_CYRILLIC
, &aInfo1
);
1808 CPPUNIT_ASSERT_MESSAGE("should return sal_False.", bRes1
== sal_False
&& bRes11
== sal_False
);
1810 aInfo2
.StructSize
= 5;
1811 sal_Bool bRes2
= rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_ARABIC
, &aInfo2
);
1812 sal_Bool bRes21
= rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_CYRILLIC
, &aInfo2
);
1813 CPPUNIT_ASSERT_MESSAGE("StructSize<6 should return sal_True", bRes2
== sal_True
&& bRes21
== sal_True
&& aInfo2
.MinimumCharSize
>=1 );
1815 aInfo3
.StructSize
= 6;
1816 sal_Bool bRes3
= rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_ARABIC
, &aInfo3
);
1817 sal_Bool bRes31
= rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_CYRILLIC
, &aInfo3
);
1818 CPPUNIT_ASSERT_MESSAGE("StructSize<6 should return sal_True", bRes3
== sal_True
&& bRes31
== sal_True
);
1819 //&& aInfo2.MinimumCharSize >=1 );
1821 aInfo4
.StructSize
= 8;
1822 sal_Bool bRes4
= rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_ARABIC
, &aInfo4
);
1823 sal_Bool bRes41
= rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_CYRILLIC
, &aInfo4
);
1824 CPPUNIT_ASSERT_MESSAGE("StructSize<6 should return sal_True", bRes4
== sal_True
&& bRes41
== sal_True
);
1825 // && aInfo2.MinimumCharSize >=1 );
1827 aInfo5
.StructSize
= sizeof aInfo5
;
1828 sal_Bool bRes5
= rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_ARABIC
, &aInfo5
);
1829 CPPUNIT_ASSERT_MESSAGE("StructSize<6 should return sal_True", bRes5
== sal_False
&& aInfo5
.Flags
== 0);
1832 CPPUNIT_TEST_SUITE(getTextEncodingInfo
);
1833 CPPUNIT_TEST(getTextEncodingInfo_001
);
1834 //CPPUNIT_TEST(getTextEncodingInfo_002);
1835 CPPUNIT_TEST_SUITE_END();
1841 class TestEncodingFromUnix
: public CppUnit::TestFixture
{
1843 void testIso8859() {
1844 check(RTL_TEXTENCODING_DONTKNOW
, "ISO8859");
1845 check(RTL_TEXTENCODING_DONTKNOW
, "ISO8859-0");
1846 check(RTL_TEXTENCODING_DONTKNOW
, "ISO8859-01");
1847 check(RTL_TEXTENCODING_DONTKNOW
, "ISO8859_1");
1848 check(RTL_TEXTENCODING_DONTKNOW
, "ISO88591");
1849 check(RTL_TEXTENCODING_ISO_8859_1
, "ISO8859-1");
1850 check(RTL_TEXTENCODING_ISO_8859_2
, "ISO8859-2");
1851 check(RTL_TEXTENCODING_ISO_8859_3
, "ISO8859-3");
1852 check(RTL_TEXTENCODING_ISO_8859_4
, "ISO8859-4");
1853 check(RTL_TEXTENCODING_ISO_8859_5
, "ISO8859-5");
1854 check(RTL_TEXTENCODING_ISO_8859_6
, "ISO8859-6");
1855 check(RTL_TEXTENCODING_ISO_8859_7
, "ISO8859-7");
1856 check(RTL_TEXTENCODING_ISO_8859_8
, "ISO8859-8");
1857 check(RTL_TEXTENCODING_ISO_8859_9
, "ISO8859-9");
1858 check(RTL_TEXTENCODING_ISO_8859_10
, "ISO8859-10");
1859 check(RTL_TEXTENCODING_TIS_620
, "ISO8859-11");
1860 check(RTL_TEXTENCODING_ISO_8859_13
, "ISO8859-13");
1861 check(RTL_TEXTENCODING_ISO_8859_14
, "ISO8859-14");
1862 check(RTL_TEXTENCODING_ISO_8859_15
, "ISO8859-15");
1866 check(RTL_TEXTENCODING_DONTKNOW
, "TIS620");
1867 check(RTL_TEXTENCODING_TIS_620
, "TIS620-0");
1868 check(RTL_TEXTENCODING_DONTKNOW
, "TIS620-1");
1869 check(RTL_TEXTENCODING_TIS_620
, "TIS620-2529");
1870 check(RTL_TEXTENCODING_TIS_620
, "TIS620-2533");
1871 check(RTL_TEXTENCODING_DONTKNOW
, "TIS620.2529-0");
1872 check(RTL_TEXTENCODING_TIS_620
, "TIS620.2529-1");
1873 check(RTL_TEXTENCODING_DONTKNOW
, "TIS620.2529-2");
1874 check(RTL_TEXTENCODING_TIS_620
, "TIS620.2533-0");
1875 check(RTL_TEXTENCODING_TIS_620
, "TIS620.2533-1");
1876 check(RTL_TEXTENCODING_DONTKNOW
, "TIS620.2533-2");
1879 CPPUNIT_TEST_SUITE(TestEncodingFromUnix
);
1880 CPPUNIT_TEST(testIso8859
);
1881 CPPUNIT_TEST(testTis620
);
1882 CPPUNIT_TEST_SUITE_END();
1885 void check(rtl_TextEncoding expected
, char const * input
) {
1886 CPPUNIT_ASSERT_EQUAL_MESSAGE(
1887 input
, expected
, rtl_getTextEncodingFromUnixCharset(input
));
1893 // -----------------------------------------------------------------------------
1895 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( rtl_tencinfo::getBestMime
, "rtl_tencinfo" );
1896 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( rtl_tencinfo::getBestUnix
, "rtl_tencinfo" );
1897 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( rtl_tencinfo::getBestWindows
, "rtl_tencinfo" );
1898 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( rtl_tencinfo::getTextEncodingInfo
, "rtl_tencinfo" );
1899 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(
1900 TestEncodingFromUnix
, "TestEncodingFromUnix");
1902 // -----------------------------------------------------------------------------