1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24
25 // MARKER(update_precomp.py): autogen include statement, do not remove
26 #include "precompiled_sal.hxx"
27 #include <string.h>
28
29 #include <osl/thread.h>
30 #include <rtl/tencinfo.h>
31
32 #include "gtest/gtest.h"
33
34 // -----------------------------------------------------------------------------
35
36 namespace rtl_tencinfo
37 {
38 class getBestMime : public ::testing::Test
39 {
40 public:
SetUp()41 void SetUp()
42 {
43 }
44
check(const sal_Char * _pRTL_TEXTENCODING,rtl_TextEncoding _aCurrentEncode)45 void check( const sal_Char* _pRTL_TEXTENCODING, rtl_TextEncoding _aCurrentEncode )
46 {
47 const sal_Char *pCharSet = rtl_getBestMimeCharsetFromTextEncoding( _aCurrentEncode );
48 if (pCharSet == 0)
49 {
50 printf("rtl_getBestMimeCharsetFromTextEncoding(%s) (%d) doesn't seem to exist.\n\n", _pRTL_TEXTENCODING, _aCurrentEncode);
51 }
52 else
53 {
54 printf("'%s' is charset: '%s'\n", _pRTL_TEXTENCODING, pCharSet);
55
56 rtl_TextEncoding eTextEnc = rtl_getTextEncodingFromMimeCharset( pCharSet );
57 if (_aCurrentEncode != eTextEnc &&
58 eTextEnc != RTL_TEXTENCODING_DONTKNOW)
59 {
60 printf("rtl_getBestMimeCharsetFromTextEncoding(%s) is charset: %s\n", _pRTL_TEXTENCODING, pCharSet);
61 printf("rtl_getTextEncodingFromMimeCharset() differ: %s %d -> %d\n\n", _pRTL_TEXTENCODING, _aCurrentEncode, eTextEnc );
62 }
63 // rtl::OString sError = "getTextEncodingFromMimeCharset(";
64 // sError += pCharSet;
65 // sError += ") returns null";
66 // ASSERT_TRUE(eTextEnc != RTL_TEXTENCODING_DONTKNOW) << sError.getStr();
67 // ASSERT_TRUE(_aCurrentEncode == eTextEnc) << "Does not realize itself";
68 }
69 }
70 };
71
72 /* ATTENTION! Whenever some encoding is added here, make sure to update
73 * rtl_isOctetEncoding in tencinfo.c.
74 */
75
76 // RTL_TEXTENCODING_USER_START
77 // RTL_TEXTENCODING_USER_END
78
79 // check( "RTL_TEXTENCODING_UCS4", RTL_TEXTENCODING_UCS4 );
80 // check( "RTL_TEXTENCODING_UCS2", RTL_TEXTENCODING_UCS2 );
81 // check( "RTL_TEXTENCODING_UNICODE", RTL_TEXTENCODING_UNICODE /* RTL_TEXTENCODING_UCS2 */ );
82
83
84 // the defines for the follows test could be found in file inc/rtl/textenc.h
85
TEST_F(getBestMime,MimeCharsetFromTextEncoding_MS_1252)86 TEST_F(getBestMime, MimeCharsetFromTextEncoding_MS_1252)
87 {
88 check( "RTL_TEXTENCODING_MS_1252", RTL_TEXTENCODING_MS_1252 );
89 }
90 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_ROMAN)91 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_ROMAN)
92 {
93 check( "RTL_TEXTENCODING_APPLE_ROMAN", RTL_TEXTENCODING_APPLE_ROMAN );
94 }
95 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_IBM_437)96 TEST_F(getBestMime, MimeCharsetFromTextEncoding_IBM_437)
97 {
98 check( "RTL_TEXTENCODING_IBM_437", RTL_TEXTENCODING_IBM_437 );
99 }
100 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_IBM_850)101 TEST_F(getBestMime, MimeCharsetFromTextEncoding_IBM_850)
102 {
103 check( "RTL_TEXTENCODING_IBM_850", RTL_TEXTENCODING_IBM_850 );
104 }
105 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_IBM_860)106 TEST_F(getBestMime, MimeCharsetFromTextEncoding_IBM_860)
107 {
108 check( "RTL_TEXTENCODING_IBM_860", RTL_TEXTENCODING_IBM_860 );
109 }
110 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_IBM_861)111 TEST_F(getBestMime, MimeCharsetFromTextEncoding_IBM_861)
112 {
113 check( "RTL_TEXTENCODING_IBM_861", RTL_TEXTENCODING_IBM_861 );
114 }
115 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_IBM_863)116 TEST_F(getBestMime, MimeCharsetFromTextEncoding_IBM_863)
117 {
118 check( "RTL_TEXTENCODING_IBM_863", RTL_TEXTENCODING_IBM_863 );
119 }
120 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_IBM_865)121 TEST_F(getBestMime, MimeCharsetFromTextEncoding_IBM_865)
122 {
123 check( "RTL_TEXTENCODING_IBM_865", RTL_TEXTENCODING_IBM_865 );
124 }
125 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_SYMBOL)126 TEST_F(getBestMime, MimeCharsetFromTextEncoding_SYMBOL)
127 {
128 check( "RTL_TEXTENCODING_SYMBOL", RTL_TEXTENCODING_SYMBOL );
129 }
130 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_ASCII_US)131 TEST_F(getBestMime, MimeCharsetFromTextEncoding_ASCII_US)
132 {
133 check( "RTL_TEXTENCODING_ASCII_US", RTL_TEXTENCODING_ASCII_US );
134 }
135 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_ISO_8859_1)136 TEST_F(getBestMime, MimeCharsetFromTextEncoding_ISO_8859_1)
137 {
138 check( "RTL_TEXTENCODING_ISO_8859_1", RTL_TEXTENCODING_ISO_8859_1 );
139 }
140 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_ISO_8859_2)141 TEST_F(getBestMime, MimeCharsetFromTextEncoding_ISO_8859_2)
142 {
143 check( "RTL_TEXTENCODING_ISO_8859_2", RTL_TEXTENCODING_ISO_8859_2 );
144 }
145 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_ISO_8859_3)146 TEST_F(getBestMime, MimeCharsetFromTextEncoding_ISO_8859_3)
147 {
148 check( "RTL_TEXTENCODING_ISO_8859_3", RTL_TEXTENCODING_ISO_8859_3 );
149 }
150 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_ISO_8859_4)151 TEST_F(getBestMime, MimeCharsetFromTextEncoding_ISO_8859_4)
152 {
153 check( "RTL_TEXTENCODING_ISO_8859_4", RTL_TEXTENCODING_ISO_8859_4 );
154 }
155 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_ISO_8859_5)156 TEST_F(getBestMime, MimeCharsetFromTextEncoding_ISO_8859_5)
157 {
158 check( "RTL_TEXTENCODING_ISO_8859_5", RTL_TEXTENCODING_ISO_8859_5 );
159 }
160 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_ISO_8859_6)161 TEST_F(getBestMime, MimeCharsetFromTextEncoding_ISO_8859_6)
162 {
163 check( "RTL_TEXTENCODING_ISO_8859_6", RTL_TEXTENCODING_ISO_8859_6 );
164 }
165 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_ISO_8859_7)166 TEST_F(getBestMime, MimeCharsetFromTextEncoding_ISO_8859_7)
167 {
168 check( "RTL_TEXTENCODING_ISO_8859_7", RTL_TEXTENCODING_ISO_8859_7 );
169 }
170 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_ISO_8859_8)171 TEST_F(getBestMime, MimeCharsetFromTextEncoding_ISO_8859_8)
172 {
173 check( "RTL_TEXTENCODING_ISO_8859_8", RTL_TEXTENCODING_ISO_8859_8 );
174 }
175 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_ISO_8859_9)176 TEST_F(getBestMime, MimeCharsetFromTextEncoding_ISO_8859_9)
177 {
178 check( "RTL_TEXTENCODING_ISO_8859_9", RTL_TEXTENCODING_ISO_8859_9 );
179 }
180 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_ISO_8859_14)181 TEST_F(getBestMime, MimeCharsetFromTextEncoding_ISO_8859_14)
182 {
183 check( "RTL_TEXTENCODING_ISO_8859_14", RTL_TEXTENCODING_ISO_8859_14 );
184 }
185 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_ISO_8859_15)186 TEST_F(getBestMime, MimeCharsetFromTextEncoding_ISO_8859_15)
187 {
188 check( "RTL_TEXTENCODING_ISO_8859_15", RTL_TEXTENCODING_ISO_8859_15 );
189 }
190 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_IBM_737)191 TEST_F(getBestMime, MimeCharsetFromTextEncoding_IBM_737)
192 {
193 check( "RTL_TEXTENCODING_IBM_737", RTL_TEXTENCODING_IBM_737 );
194 }
195 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_IBM_775)196 TEST_F(getBestMime, MimeCharsetFromTextEncoding_IBM_775)
197 {
198 check( "RTL_TEXTENCODING_IBM_775", RTL_TEXTENCODING_IBM_775 );
199 }
200 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_IBM_852)201 TEST_F(getBestMime, MimeCharsetFromTextEncoding_IBM_852)
202 {
203 check( "RTL_TEXTENCODING_IBM_852", RTL_TEXTENCODING_IBM_852 );
204 }
205 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_IBM_855)206 TEST_F(getBestMime, MimeCharsetFromTextEncoding_IBM_855)
207 {
208 check( "RTL_TEXTENCODING_IBM_855", RTL_TEXTENCODING_IBM_855 );
209 }
210 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_IBM_857)211 TEST_F(getBestMime, MimeCharsetFromTextEncoding_IBM_857)
212 {
213 check( "RTL_TEXTENCODING_IBM_857", RTL_TEXTENCODING_IBM_857 );
214 }
215 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_IBM_862)216 TEST_F(getBestMime, MimeCharsetFromTextEncoding_IBM_862)
217 {
218 check( "RTL_TEXTENCODING_IBM_862", RTL_TEXTENCODING_IBM_862 );
219 }
220 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_IBM_864)221 TEST_F(getBestMime, MimeCharsetFromTextEncoding_IBM_864)
222 {
223 check( "RTL_TEXTENCODING_IBM_864", RTL_TEXTENCODING_IBM_864 );
224 }
225 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_IBM_866)226 TEST_F(getBestMime, MimeCharsetFromTextEncoding_IBM_866)
227 {
228 check( "RTL_TEXTENCODING_IBM_866", RTL_TEXTENCODING_IBM_866 );
229 }
230 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_IBM_869)231 TEST_F(getBestMime, MimeCharsetFromTextEncoding_IBM_869)
232 {
233 check( "RTL_TEXTENCODING_IBM_869", RTL_TEXTENCODING_IBM_869 );
234 }
235 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_MS_874)236 TEST_F(getBestMime, MimeCharsetFromTextEncoding_MS_874)
237 {
238 check( "RTL_TEXTENCODING_MS_874", RTL_TEXTENCODING_MS_874 );
239 }
240 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_MS_1250)241 TEST_F(getBestMime, MimeCharsetFromTextEncoding_MS_1250)
242 {
243 check( "RTL_TEXTENCODING_MS_1250", RTL_TEXTENCODING_MS_1250 );
244 }
245 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_MS_1251)246 TEST_F(getBestMime, MimeCharsetFromTextEncoding_MS_1251)
247 {
248 check( "RTL_TEXTENCODING_MS_1251", RTL_TEXTENCODING_MS_1251 );
249 }
250 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_MS_1253)251 TEST_F(getBestMime, MimeCharsetFromTextEncoding_MS_1253)
252 {
253 check( "RTL_TEXTENCODING_MS_1253", RTL_TEXTENCODING_MS_1253 );
254 }
255 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_MS_1254)256 TEST_F(getBestMime, MimeCharsetFromTextEncoding_MS_1254)
257 {
258 check( "RTL_TEXTENCODING_MS_1254", RTL_TEXTENCODING_MS_1254 );
259 }
260 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_MS_1255)261 TEST_F(getBestMime, MimeCharsetFromTextEncoding_MS_1255)
262 {
263 check( "RTL_TEXTENCODING_MS_1255", RTL_TEXTENCODING_MS_1255 );
264 }
265 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_MS_1256)266 TEST_F(getBestMime, MimeCharsetFromTextEncoding_MS_1256)
267 {
268 check( "RTL_TEXTENCODING_MS_1256", RTL_TEXTENCODING_MS_1256 );
269 }
270 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_MS_1257)271 TEST_F(getBestMime, MimeCharsetFromTextEncoding_MS_1257)
272 {
273 check( "RTL_TEXTENCODING_MS_1257", RTL_TEXTENCODING_MS_1257 );
274 }
275 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_MS_1258)276 TEST_F(getBestMime, MimeCharsetFromTextEncoding_MS_1258)
277 {
278 check( "RTL_TEXTENCODING_MS_1258", RTL_TEXTENCODING_MS_1258 );
279 }
280 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_ARABIC)281 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_ARABIC)
282 {
283 check( "RTL_TEXTENCODING_APPLE_ARABIC", RTL_TEXTENCODING_APPLE_ARABIC );
284 }
285 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_CENTEURO)286 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_CENTEURO)
287 {
288 check( "RTL_TEXTENCODING_APPLE_CENTEURO", RTL_TEXTENCODING_APPLE_CENTEURO );
289 }
290 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_CROATIAN)291 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_CROATIAN)
292 {
293 check( "RTL_TEXTENCODING_APPLE_CROATIAN", RTL_TEXTENCODING_APPLE_CROATIAN );
294 }
295 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_CYRILLIC)296 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_CYRILLIC)
297 {
298 check( "RTL_TEXTENCODING_APPLE_CYRILLIC", RTL_TEXTENCODING_APPLE_CYRILLIC );
299 }
300 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_DEVANAGARI)301 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_DEVANAGARI)
302 {
303 check( "RTL_TEXTENCODING_APPLE_DEVANAGARI", RTL_TEXTENCODING_APPLE_DEVANAGARI );
304 }
305 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_FARSI)306 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_FARSI)
307 {
308 check( "RTL_TEXTENCODING_APPLE_FARSI", RTL_TEXTENCODING_APPLE_FARSI );
309 }
310 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_GREEK)311 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_GREEK)
312 {
313 check( "RTL_TEXTENCODING_APPLE_GREEK", RTL_TEXTENCODING_APPLE_GREEK );
314 }
315 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_GUJARATI)316 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_GUJARATI)
317 {
318 check( "RTL_TEXTENCODING_APPLE_GUJARATI", RTL_TEXTENCODING_APPLE_GUJARATI );
319 }
320 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_GURMUKHI)321 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_GURMUKHI)
322 {
323 check( "RTL_TEXTENCODING_APPLE_GURMUKHI", RTL_TEXTENCODING_APPLE_GURMUKHI );
324 }
325 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_HEBREW)326 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_HEBREW)
327 {
328 check( "RTL_TEXTENCODING_APPLE_HEBREW", RTL_TEXTENCODING_APPLE_HEBREW );
329 }
330 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_ICELAND)331 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_ICELAND)
332 {
333 check( "RTL_TEXTENCODING_APPLE_ICELAND", RTL_TEXTENCODING_APPLE_ICELAND );
334 }
335 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_ROMANIAN)336 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_ROMANIAN)
337 {
338 check( "RTL_TEXTENCODING_APPLE_ROMANIAN", RTL_TEXTENCODING_APPLE_ROMANIAN );
339 }
340 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_THAI)341 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_THAI)
342 {
343 check( "RTL_TEXTENCODING_APPLE_THAI", RTL_TEXTENCODING_APPLE_THAI );
344 }
345 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_TURKISH)346 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_TURKISH)
347 {
348 check( "RTL_TEXTENCODING_APPLE_TURKISH", RTL_TEXTENCODING_APPLE_TURKISH );
349 }
350 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_UKRAINIAN)351 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_UKRAINIAN)
352 {
353 check( "RTL_TEXTENCODING_APPLE_UKRAINIAN", RTL_TEXTENCODING_APPLE_UKRAINIAN );
354 }
355 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_CHINSIMP)356 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_CHINSIMP)
357 {
358 check( "RTL_TEXTENCODING_APPLE_CHINSIMP", RTL_TEXTENCODING_APPLE_CHINSIMP );
359 }
360 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_CHINTRAD)361 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_CHINTRAD)
362 {
363 check( "RTL_TEXTENCODING_APPLE_CHINTRAD", RTL_TEXTENCODING_APPLE_CHINTRAD );
364 }
365 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_JAPANESE)366 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_JAPANESE)
367 {
368 check( "RTL_TEXTENCODING_APPLE_JAPANESE", RTL_TEXTENCODING_APPLE_JAPANESE );
369 }
370 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_APPLE_KOREAN)371 TEST_F(getBestMime, MimeCharsetFromTextEncoding_APPLE_KOREAN)
372 {
373 check( "RTL_TEXTENCODING_APPLE_KOREAN", RTL_TEXTENCODING_APPLE_KOREAN );
374 }
375 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_MS_932)376 TEST_F(getBestMime, MimeCharsetFromTextEncoding_MS_932)
377 {
378 check( "RTL_TEXTENCODING_MS_932", RTL_TEXTENCODING_MS_932 );
379 }
380 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_MS_936)381 TEST_F(getBestMime, MimeCharsetFromTextEncoding_MS_936)
382 {
383 check( "RTL_TEXTENCODING_MS_936", RTL_TEXTENCODING_MS_936 );
384 }
385 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_MS_949)386 TEST_F(getBestMime, MimeCharsetFromTextEncoding_MS_949)
387 {
388 check( "RTL_TEXTENCODING_MS_949", RTL_TEXTENCODING_MS_949 );
389 }
390 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_MS_950)391 TEST_F(getBestMime, MimeCharsetFromTextEncoding_MS_950)
392 {
393 check( "RTL_TEXTENCODING_MS_950", RTL_TEXTENCODING_MS_950 );
394 }
395 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_SHIFT_JIS)396 TEST_F(getBestMime, MimeCharsetFromTextEncoding_SHIFT_JIS)
397 {
398 check( "RTL_TEXTENCODING_SHIFT_JIS", RTL_TEXTENCODING_SHIFT_JIS );
399 }
400 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_GB_2312)401 TEST_F(getBestMime, MimeCharsetFromTextEncoding_GB_2312)
402 {
403 check( "RTL_TEXTENCODING_GB_2312", RTL_TEXTENCODING_GB_2312 );
404 }
405 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_GBT_12345)406 TEST_F(getBestMime, MimeCharsetFromTextEncoding_GBT_12345)
407 {
408 check( "RTL_TEXTENCODING_GBT_12345", RTL_TEXTENCODING_GBT_12345 );
409 }
410 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_GBK)411 TEST_F(getBestMime, MimeCharsetFromTextEncoding_GBK)
412 {
413 check( "RTL_TEXTENCODING_GBK", RTL_TEXTENCODING_GBK );
414 }
415 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_BIG5)416 TEST_F(getBestMime, MimeCharsetFromTextEncoding_BIG5)
417 {
418 check( "RTL_TEXTENCODING_BIG5", RTL_TEXTENCODING_BIG5 );
419 }
420 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_EUC_JP)421 TEST_F(getBestMime, MimeCharsetFromTextEncoding_EUC_JP)
422 {
423 check( "RTL_TEXTENCODING_EUC_JP", RTL_TEXTENCODING_EUC_JP );
424 }
425 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_EUC_CN)426 TEST_F(getBestMime, MimeCharsetFromTextEncoding_EUC_CN)
427 {
428 check( "RTL_TEXTENCODING_EUC_CN", RTL_TEXTENCODING_EUC_CN );
429 }
430 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_EUC_TW)431 TEST_F(getBestMime, MimeCharsetFromTextEncoding_EUC_TW)
432 {
433 check( "RTL_TEXTENCODING_EUC_TW", RTL_TEXTENCODING_EUC_TW );
434 }
435 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_ISO_2022_JP)436 TEST_F(getBestMime, MimeCharsetFromTextEncoding_ISO_2022_JP)
437 {
438 check( "RTL_TEXTENCODING_ISO_2022_JP", RTL_TEXTENCODING_ISO_2022_JP );
439 }
440 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_ISO_2022_CN)441 TEST_F(getBestMime, MimeCharsetFromTextEncoding_ISO_2022_CN)
442 {
443 check( "RTL_TEXTENCODING_ISO_2022_CN", RTL_TEXTENCODING_ISO_2022_CN );
444 }
445 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_KOI8_R)446 TEST_F(getBestMime, MimeCharsetFromTextEncoding_KOI8_R)
447 {
448 check( "RTL_TEXTENCODING_KOI8_R", RTL_TEXTENCODING_KOI8_R );
449 }
450 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_UTF7)451 TEST_F(getBestMime, MimeCharsetFromTextEncoding_UTF7)
452 {
453 check( "RTL_TEXTENCODING_UTF7", RTL_TEXTENCODING_UTF7 );
454 }
455 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_UTF8)456 TEST_F(getBestMime, MimeCharsetFromTextEncoding_UTF8)
457 {
458 check( "RTL_TEXTENCODING_UTF8", RTL_TEXTENCODING_UTF8 );
459 }
460 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_ISO_8859_10)461 TEST_F(getBestMime, MimeCharsetFromTextEncoding_ISO_8859_10)
462 {
463 check( "RTL_TEXTENCODING_ISO_8859_10", RTL_TEXTENCODING_ISO_8859_10 );
464 }
465 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_ISO_8859_13)466 TEST_F(getBestMime, MimeCharsetFromTextEncoding_ISO_8859_13)
467 {
468 check( "RTL_TEXTENCODING_ISO_8859_13", RTL_TEXTENCODING_ISO_8859_13 );
469 }
470 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_EUC_KR)471 TEST_F(getBestMime, MimeCharsetFromTextEncoding_EUC_KR)
472 {
473 check( "RTL_TEXTENCODING_EUC_KR", RTL_TEXTENCODING_EUC_KR );
474 }
475 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_ISO_2022_KR)476 TEST_F(getBestMime, MimeCharsetFromTextEncoding_ISO_2022_KR)
477 {
478 check( "RTL_TEXTENCODING_ISO_2022_KR", RTL_TEXTENCODING_ISO_2022_KR );
479 }
480 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_JIS_X_0201)481 TEST_F(getBestMime, MimeCharsetFromTextEncoding_JIS_X_0201)
482 {
483 check( "RTL_TEXTENCODING_JIS_X_0201", RTL_TEXTENCODING_JIS_X_0201 );
484 }
485 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_JIS_X_0208)486 TEST_F(getBestMime, MimeCharsetFromTextEncoding_JIS_X_0208)
487 {
488 check( "RTL_TEXTENCODING_JIS_X_0208", RTL_TEXTENCODING_JIS_X_0208 );
489 }
490 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_JIS_X_0212)491 TEST_F(getBestMime, MimeCharsetFromTextEncoding_JIS_X_0212)
492 {
493 check( "RTL_TEXTENCODING_JIS_X_0212", RTL_TEXTENCODING_JIS_X_0212 );
494 }
495 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_MS_1361)496 TEST_F(getBestMime, MimeCharsetFromTextEncoding_MS_1361)
497 {
498 check( "RTL_TEXTENCODING_MS_1361", RTL_TEXTENCODING_MS_1361 );
499 }
500 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_GB_18030)501 TEST_F(getBestMime, MimeCharsetFromTextEncoding_GB_18030)
502 {
503 check( "RTL_TEXTENCODING_GB_18030", RTL_TEXTENCODING_GB_18030 );
504 }
505 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_BIG5_HKSCS)506 TEST_F(getBestMime, MimeCharsetFromTextEncoding_BIG5_HKSCS)
507 {
508 check( "RTL_TEXTENCODING_BIG5_HKSCS", RTL_TEXTENCODING_BIG5_HKSCS );
509 }
510 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_TIS_620)511 TEST_F(getBestMime, MimeCharsetFromTextEncoding_TIS_620)
512 {
513 check( "RTL_TEXTENCODING_TIS_620", RTL_TEXTENCODING_TIS_620 );
514 }
515 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_KOI8_U)516 TEST_F(getBestMime, MimeCharsetFromTextEncoding_KOI8_U)
517 {
518 check( "RTL_TEXTENCODING_KOI8_U", RTL_TEXTENCODING_KOI8_U );
519 }
520 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_ISCII_DEVANAGARI)521 TEST_F(getBestMime, MimeCharsetFromTextEncoding_ISCII_DEVANAGARI)
522 {
523 check( "RTL_TEXTENCODING_ISCII_DEVANAGARI", RTL_TEXTENCODING_ISCII_DEVANAGARI );
524 }
525 // ----------------------------------------
TEST_F(getBestMime,MimeCharsetFromTextEncoding_JAVA_UTF8)526 TEST_F(getBestMime, MimeCharsetFromTextEncoding_JAVA_UTF8)
527 {
528 check( "RTL_TEXTENCODING_JAVA_UTF8", RTL_TEXTENCODING_JAVA_UTF8 );
529 }
530
531
532 // -----------------------------------------------------------------------------
533
534 class getBestUnix : public ::testing::Test
535 {
536 public:
SetUp()537 void SetUp()
538 {
539 }
540
check(const sal_Char * _pRTL_TEXTENCODING,rtl_TextEncoding _aCurrentEncode)541 void check( const sal_Char* _pRTL_TEXTENCODING, rtl_TextEncoding _aCurrentEncode )
542 {
543 const sal_Char *pCharSet = rtl_getBestUnixCharsetFromTextEncoding( _aCurrentEncode );
544 if (pCharSet == 0)
545 {
546 printf("rtl_getBestUnixCharsetFromTextEncoding(%s) (%d) doesn't seem to exist.\n\n", _pRTL_TEXTENCODING, _aCurrentEncode);
547 }
548 else
549 {
550 printf("'%s' is charset: '%s'\n", _pRTL_TEXTENCODING, pCharSet);
551
552 rtl_TextEncoding eTextEnc = rtl_getTextEncodingFromUnixCharset( pCharSet );
553 if (_aCurrentEncode != eTextEnc &&
554 eTextEnc != RTL_TEXTENCODING_DONTKNOW)
555 {
556 printf("rtl_getBestUnixCharsetFromTextEncoding(%s) is charset: %s\n", _pRTL_TEXTENCODING, pCharSet);
557 printf("rtl_getTextEncodingFromUnixCharset() differ: %s %d -> %d\n\n", _pRTL_TEXTENCODING, _aCurrentEncode, eTextEnc );
558 }
559 // rtl::OString sError = "getTextEncodingFromUnixCharset(";
560 // sError += pCharSet;
561 // sError += ") returns null";
562 // ASSERT_TRUE(eTextEnc != RTL_TEXTENCODING_DONTKNOW) << sError.getStr();
563 // ASSERT_TRUE(_aCurrentEncode == eTextEnc) << "Does not realize itself";
564 }
565 }
566 };
567
568 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_MS_1252)569 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_MS_1252)
570 {
571 check( "RTL_TEXTENCODING_MS_1252", RTL_TEXTENCODING_MS_1252 );
572 }
573 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_ROMAN)574 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_ROMAN)
575 {
576 check( "RTL_TEXTENCODING_APPLE_ROMAN", RTL_TEXTENCODING_APPLE_ROMAN );
577 }
578 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_IBM_437)579 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_IBM_437)
580 {
581 check( "RTL_TEXTENCODING_IBM_437", RTL_TEXTENCODING_IBM_437 );
582 }
583 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_IBM_850)584 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_IBM_850)
585 {
586 check( "RTL_TEXTENCODING_IBM_850", RTL_TEXTENCODING_IBM_850 );
587 }
588 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_IBM_860)589 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_IBM_860)
590 {
591 check( "RTL_TEXTENCODING_IBM_860", RTL_TEXTENCODING_IBM_860 );
592 }
593 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_IBM_861)594 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_IBM_861)
595 {
596 check( "RTL_TEXTENCODING_IBM_861", RTL_TEXTENCODING_IBM_861 );
597 }
598 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_IBM_863)599 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_IBM_863)
600 {
601 check( "RTL_TEXTENCODING_IBM_863", RTL_TEXTENCODING_IBM_863 );
602 }
603 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_IBM_865)604 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_IBM_865)
605 {
606 check( "RTL_TEXTENCODING_IBM_865", RTL_TEXTENCODING_IBM_865 );
607 }
608 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_SYMBOL)609 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_SYMBOL)
610 {
611 check( "RTL_TEXTENCODING_SYMBOL", RTL_TEXTENCODING_SYMBOL );
612 }
613 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_ASCII_US)614 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_ASCII_US)
615 {
616 check( "RTL_TEXTENCODING_ASCII_US", RTL_TEXTENCODING_ASCII_US );
617 }
618 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_ISO_8859_1)619 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_ISO_8859_1)
620 {
621 check( "RTL_TEXTENCODING_ISO_8859_1", RTL_TEXTENCODING_ISO_8859_1 );
622 }
623 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_ISO_8859_2)624 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_ISO_8859_2)
625 {
626 check( "RTL_TEXTENCODING_ISO_8859_2", RTL_TEXTENCODING_ISO_8859_2 );
627 }
628 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_ISO_8859_3)629 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_ISO_8859_3)
630 {
631 check( "RTL_TEXTENCODING_ISO_8859_3", RTL_TEXTENCODING_ISO_8859_3 );
632 }
633 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_ISO_8859_4)634 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_ISO_8859_4)
635 {
636 check( "RTL_TEXTENCODING_ISO_8859_4", RTL_TEXTENCODING_ISO_8859_4 );
637 }
638 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_ISO_8859_5)639 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_ISO_8859_5)
640 {
641 check( "RTL_TEXTENCODING_ISO_8859_5", RTL_TEXTENCODING_ISO_8859_5 );
642 }
643 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_ISO_8859_6)644 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_ISO_8859_6)
645 {
646 check( "RTL_TEXTENCODING_ISO_8859_6", RTL_TEXTENCODING_ISO_8859_6 );
647 }
648 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_ISO_8859_7)649 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_ISO_8859_7)
650 {
651 check( "RTL_TEXTENCODING_ISO_8859_7", RTL_TEXTENCODING_ISO_8859_7 );
652 }
653 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_ISO_8859_8)654 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_ISO_8859_8)
655 {
656 check( "RTL_TEXTENCODING_ISO_8859_8", RTL_TEXTENCODING_ISO_8859_8 );
657 }
658 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_ISO_8859_9)659 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_ISO_8859_9)
660 {
661 check( "RTL_TEXTENCODING_ISO_8859_9", RTL_TEXTENCODING_ISO_8859_9 );
662 }
663 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_ISO_8859_14)664 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_ISO_8859_14)
665 {
666 check( "RTL_TEXTENCODING_ISO_8859_14", RTL_TEXTENCODING_ISO_8859_14 );
667 }
668 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_ISO_8859_15)669 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_ISO_8859_15)
670 {
671 check( "RTL_TEXTENCODING_ISO_8859_15", RTL_TEXTENCODING_ISO_8859_15 );
672 }
673 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_IBM_737)674 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_IBM_737)
675 {
676 check( "RTL_TEXTENCODING_IBM_737", RTL_TEXTENCODING_IBM_737 );
677 }
678 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_IBM_775)679 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_IBM_775)
680 {
681 check( "RTL_TEXTENCODING_IBM_775", RTL_TEXTENCODING_IBM_775 );
682 }
683 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_IBM_852)684 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_IBM_852)
685 {
686 check( "RTL_TEXTENCODING_IBM_852", RTL_TEXTENCODING_IBM_852 );
687 }
688 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_IBM_855)689 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_IBM_855)
690 {
691 check( "RTL_TEXTENCODING_IBM_855", RTL_TEXTENCODING_IBM_855 );
692 }
693 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_IBM_857)694 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_IBM_857)
695 {
696 check( "RTL_TEXTENCODING_IBM_857", RTL_TEXTENCODING_IBM_857 );
697 }
698 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_IBM_862)699 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_IBM_862)
700 {
701 check( "RTL_TEXTENCODING_IBM_862", RTL_TEXTENCODING_IBM_862 );
702 }
703 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_IBM_864)704 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_IBM_864)
705 {
706 check( "RTL_TEXTENCODING_IBM_864", RTL_TEXTENCODING_IBM_864 );
707 }
708 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_IBM_866)709 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_IBM_866)
710 {
711 check( "RTL_TEXTENCODING_IBM_866", RTL_TEXTENCODING_IBM_866 );
712 }
713 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_IBM_869)714 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_IBM_869)
715 {
716 check( "RTL_TEXTENCODING_IBM_869", RTL_TEXTENCODING_IBM_869 );
717 }
718 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_MS_874)719 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_MS_874)
720 {
721 check( "RTL_TEXTENCODING_MS_874", RTL_TEXTENCODING_MS_874 );
722 }
723 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_MS_1250)724 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_MS_1250)
725 {
726 check( "RTL_TEXTENCODING_MS_1250", RTL_TEXTENCODING_MS_1250 );
727 }
728 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_MS_1251)729 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_MS_1251)
730 {
731 check( "RTL_TEXTENCODING_MS_1251", RTL_TEXTENCODING_MS_1251 );
732 }
733 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_MS_1253)734 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_MS_1253)
735 {
736 check( "RTL_TEXTENCODING_MS_1253", RTL_TEXTENCODING_MS_1253 );
737 }
738 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_MS_1254)739 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_MS_1254)
740 {
741 check( "RTL_TEXTENCODING_MS_1254", RTL_TEXTENCODING_MS_1254 );
742 }
743 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_MS_1255)744 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_MS_1255)
745 {
746 check( "RTL_TEXTENCODING_MS_1255", RTL_TEXTENCODING_MS_1255 );
747 }
748 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_MS_1256)749 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_MS_1256)
750 {
751 check( "RTL_TEXTENCODING_MS_1256", RTL_TEXTENCODING_MS_1256 );
752 }
753 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_MS_1257)754 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_MS_1257)
755 {
756 check( "RTL_TEXTENCODING_MS_1257", RTL_TEXTENCODING_MS_1257 );
757 }
758 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_MS_1258)759 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_MS_1258)
760 {
761 check( "RTL_TEXTENCODING_MS_1258", RTL_TEXTENCODING_MS_1258 );
762 }
763 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_ARABIC)764 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_ARABIC)
765 {
766 check( "RTL_TEXTENCODING_APPLE_ARABIC", RTL_TEXTENCODING_APPLE_ARABIC );
767 }
768 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_CENTEURO)769 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_CENTEURO)
770 {
771 check( "RTL_TEXTENCODING_APPLE_CENTEURO", RTL_TEXTENCODING_APPLE_CENTEURO );
772 }
773 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_CROATIAN)774 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_CROATIAN)
775 {
776 check( "RTL_TEXTENCODING_APPLE_CROATIAN", RTL_TEXTENCODING_APPLE_CROATIAN );
777 }
778 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_CYRILLIC)779 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_CYRILLIC)
780 {
781 check( "RTL_TEXTENCODING_APPLE_CYRILLIC", RTL_TEXTENCODING_APPLE_CYRILLIC );
782 }
783 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_DEVANAGARI)784 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_DEVANAGARI)
785 {
786 check( "RTL_TEXTENCODING_APPLE_DEVANAGARI", RTL_TEXTENCODING_APPLE_DEVANAGARI );
787 }
788 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_FARSI)789 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_FARSI)
790 {
791 check( "RTL_TEXTENCODING_APPLE_FARSI", RTL_TEXTENCODING_APPLE_FARSI );
792 }
793 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_GREEK)794 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_GREEK)
795 {
796 check( "RTL_TEXTENCODING_APPLE_GREEK", RTL_TEXTENCODING_APPLE_GREEK );
797 }
798 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_GUJARATI)799 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_GUJARATI)
800 {
801 check( "RTL_TEXTENCODING_APPLE_GUJARATI", RTL_TEXTENCODING_APPLE_GUJARATI );
802 }
803 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_GURMUKHI)804 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_GURMUKHI)
805 {
806 check( "RTL_TEXTENCODING_APPLE_GURMUKHI", RTL_TEXTENCODING_APPLE_GURMUKHI );
807 }
808 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_HEBREW)809 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_HEBREW)
810 {
811 check( "RTL_TEXTENCODING_APPLE_HEBREW", RTL_TEXTENCODING_APPLE_HEBREW );
812 }
813 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_ICELAND)814 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_ICELAND)
815 {
816 check( "RTL_TEXTENCODING_APPLE_ICELAND", RTL_TEXTENCODING_APPLE_ICELAND );
817 }
818 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_ROMANIAN)819 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_ROMANIAN)
820 {
821 check( "RTL_TEXTENCODING_APPLE_ROMANIAN", RTL_TEXTENCODING_APPLE_ROMANIAN );
822 }
823 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_THAI)824 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_THAI)
825 {
826 check( "RTL_TEXTENCODING_APPLE_THAI", RTL_TEXTENCODING_APPLE_THAI );
827 }
828 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_TURKISH)829 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_TURKISH)
830 {
831 check( "RTL_TEXTENCODING_APPLE_TURKISH", RTL_TEXTENCODING_APPLE_TURKISH );
832 }
833 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_UKRAINIAN)834 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_UKRAINIAN)
835 {
836 check( "RTL_TEXTENCODING_APPLE_UKRAINIAN", RTL_TEXTENCODING_APPLE_UKRAINIAN );
837 }
838 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_CHINSIMP)839 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_CHINSIMP)
840 {
841 check( "RTL_TEXTENCODING_APPLE_CHINSIMP", RTL_TEXTENCODING_APPLE_CHINSIMP );
842 }
843 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_CHINTRAD)844 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_CHINTRAD)
845 {
846 check( "RTL_TEXTENCODING_APPLE_CHINTRAD", RTL_TEXTENCODING_APPLE_CHINTRAD );
847 }
848 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_JAPANESE)849 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_JAPANESE)
850 {
851 check( "RTL_TEXTENCODING_APPLE_JAPANESE", RTL_TEXTENCODING_APPLE_JAPANESE );
852 }
853 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_APPLE_KOREAN)854 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_APPLE_KOREAN)
855 {
856 check( "RTL_TEXTENCODING_APPLE_KOREAN", RTL_TEXTENCODING_APPLE_KOREAN );
857 }
858 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_MS_932)859 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_MS_932)
860 {
861 check( "RTL_TEXTENCODING_MS_932", RTL_TEXTENCODING_MS_932 );
862 }
863 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_MS_936)864 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_MS_936)
865 {
866 check( "RTL_TEXTENCODING_MS_936", RTL_TEXTENCODING_MS_936 );
867 }
868 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_MS_949)869 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_MS_949)
870 {
871 check( "RTL_TEXTENCODING_MS_949", RTL_TEXTENCODING_MS_949 );
872 }
873 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_MS_950)874 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_MS_950)
875 {
876 check( "RTL_TEXTENCODING_MS_950", RTL_TEXTENCODING_MS_950 );
877 }
878 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_SHIFT_JIS)879 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_SHIFT_JIS)
880 {
881 check( "RTL_TEXTENCODING_SHIFT_JIS", RTL_TEXTENCODING_SHIFT_JIS );
882 }
883 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_GB_2312)884 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_GB_2312)
885 {
886 check( "RTL_TEXTENCODING_GB_2312", RTL_TEXTENCODING_GB_2312 );
887 }
888 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_GBT_12345)889 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_GBT_12345)
890 {
891 check( "RTL_TEXTENCODING_GBT_12345", RTL_TEXTENCODING_GBT_12345 );
892 }
893 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_GBK)894 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_GBK)
895 {
896 check( "RTL_TEXTENCODING_GBK", RTL_TEXTENCODING_GBK );
897 }
898 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_BIG5)899 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_BIG5)
900 {
901 check( "RTL_TEXTENCODING_BIG5", RTL_TEXTENCODING_BIG5 );
902 }
903 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_EUC_JP)904 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_EUC_JP)
905 {
906 check( "RTL_TEXTENCODING_EUC_JP", RTL_TEXTENCODING_EUC_JP );
907 }
908 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_EUC_CN)909 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_EUC_CN)
910 {
911 check( "RTL_TEXTENCODING_EUC_CN", RTL_TEXTENCODING_EUC_CN );
912 }
913 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_EUC_TW)914 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_EUC_TW)
915 {
916 check( "RTL_TEXTENCODING_EUC_TW", RTL_TEXTENCODING_EUC_TW );
917 }
918 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_ISO_2022_JP)919 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_ISO_2022_JP)
920 {
921 check( "RTL_TEXTENCODING_ISO_2022_JP", RTL_TEXTENCODING_ISO_2022_JP );
922 }
923 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_ISO_2022_CN)924 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_ISO_2022_CN)
925 {
926 check( "RTL_TEXTENCODING_ISO_2022_CN", RTL_TEXTENCODING_ISO_2022_CN );
927 }
928 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_KOI8_R)929 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_KOI8_R)
930 {
931 check( "RTL_TEXTENCODING_KOI8_R", RTL_TEXTENCODING_KOI8_R );
932 }
933 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_UTF7)934 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_UTF7)
935 {
936 check( "RTL_TEXTENCODING_UTF7", RTL_TEXTENCODING_UTF7 );
937 }
938 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_UTF8)939 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_UTF8)
940 {
941 check( "RTL_TEXTENCODING_UTF8", RTL_TEXTENCODING_UTF8 );
942 }
943 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_ISO_8859_10)944 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_ISO_8859_10)
945 {
946 check( "RTL_TEXTENCODING_ISO_8859_10", RTL_TEXTENCODING_ISO_8859_10 );
947 }
948 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_ISO_8859_13)949 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_ISO_8859_13)
950 {
951 check( "RTL_TEXTENCODING_ISO_8859_13", RTL_TEXTENCODING_ISO_8859_13 );
952 }
953 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_EUC_KR)954 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_EUC_KR)
955 {
956 check( "RTL_TEXTENCODING_EUC_KR", RTL_TEXTENCODING_EUC_KR );
957 }
958 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_ISO_2022_KR)959 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_ISO_2022_KR)
960 {
961 check( "RTL_TEXTENCODING_ISO_2022_KR", RTL_TEXTENCODING_ISO_2022_KR );
962 }
963 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_JIS_X_0201)964 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_JIS_X_0201)
965 {
966 check( "RTL_TEXTENCODING_JIS_X_0201", RTL_TEXTENCODING_JIS_X_0201 );
967 }
968 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_JIS_X_0208)969 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_JIS_X_0208)
970 {
971 check( "RTL_TEXTENCODING_JIS_X_0208", RTL_TEXTENCODING_JIS_X_0208 );
972 }
973 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_JIS_X_0212)974 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_JIS_X_0212)
975 {
976 check( "RTL_TEXTENCODING_JIS_X_0212", RTL_TEXTENCODING_JIS_X_0212 );
977 }
978 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_MS_1361)979 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_MS_1361)
980 {
981 check( "RTL_TEXTENCODING_MS_1361", RTL_TEXTENCODING_MS_1361 );
982 }
983 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_GB_18030)984 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_GB_18030)
985 {
986 check( "RTL_TEXTENCODING_GB_18030", RTL_TEXTENCODING_GB_18030 );
987 }
988 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_BIG5_HKSCS)989 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_BIG5_HKSCS)
990 {
991 check( "RTL_TEXTENCODING_BIG5_HKSCS", RTL_TEXTENCODING_BIG5_HKSCS );
992 }
993 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_TIS_620)994 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_TIS_620)
995 {
996 check( "RTL_TEXTENCODING_TIS_620", RTL_TEXTENCODING_TIS_620 );
997 }
998 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_KOI8_U)999 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_KOI8_U)
1000 {
1001 check( "RTL_TEXTENCODING_KOI8_U", RTL_TEXTENCODING_KOI8_U );
1002 }
1003 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_ISCII_DEVANAGARI)1004 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_ISCII_DEVANAGARI)
1005 {
1006 check( "RTL_TEXTENCODING_ISCII_DEVANAGARI", RTL_TEXTENCODING_ISCII_DEVANAGARI );
1007 }
1008 // ----------------------------------------
TEST_F(getBestUnix,UnixCharsetFromTextEncoding_JAVA_UTF8)1009 TEST_F(getBestUnix, UnixCharsetFromTextEncoding_JAVA_UTF8)
1010 {
1011 check( "RTL_TEXTENCODING_JAVA_UTF8", RTL_TEXTENCODING_JAVA_UTF8 );
1012 }
1013 // ----------------------------------------
1014
1015 // -----------------------------------------------------------------------------
1016
1017
1018 class getBestWindows : public ::testing::Test
1019 {
1020 public:
SetUp()1021 void SetUp()
1022 {
1023 }
1024
check(const sal_Char * _pRTL_TEXTENCODING,rtl_TextEncoding _aCurrentEncode)1025 void check( const sal_Char* _pRTL_TEXTENCODING, rtl_TextEncoding _aCurrentEncode )
1026 {
1027 const sal_uInt8 nCharSet = rtl_getBestWindowsCharsetFromTextEncoding( _aCurrentEncode );
1028 if (nCharSet == 1)
1029 {
1030 printf("rtl_getBestWindowsCharsetFromTextEncoding(%s) (%d) doesn't seem to exist.\n\n", _pRTL_TEXTENCODING, _aCurrentEncode);
1031 }
1032 else
1033 {
1034 printf("'%s' is charset: '%d'\n", _pRTL_TEXTENCODING, nCharSet);
1035
1036 rtl_TextEncoding eTextEnc = rtl_getTextEncodingFromWindowsCharset( nCharSet );
1037 if (_aCurrentEncode != eTextEnc &&
1038 eTextEnc != RTL_TEXTENCODING_DONTKNOW)
1039 {
1040 printf("rtl_getBestUnixCharsetFromTextEncoding(%s) is charset: %d\n", _pRTL_TEXTENCODING, nCharSet);
1041 printf("rtl_getTextEncodingFromWindowsCharset() differ: %s %d -> %d\n\n", _pRTL_TEXTENCODING, _aCurrentEncode, eTextEnc );
1042 }
1043 // rtl::OString sError = "getTextEncodingFromWindowsCharset(";
1044 // sError += rtl::OString::valueOf(nCharSet);
1045 // sError += ") returns nul.";
1046
1047 // ASSERT_TRUE(eTextEnc != RTL_TEXTENCODING_DONTKNOW) << sError.getStr();
1048 // ASSERT_TRUE(_aCurrentEncode == eTextEnc) << "Does not realize itself";
1049 }
1050 }
1051 };
1052
1053 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_MS_1252)1054 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_MS_1252)
1055 {
1056 check( "RTL_TEXTENCODING_MS_1252", RTL_TEXTENCODING_MS_1252 );
1057 }
1058 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_ROMAN)1059 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_ROMAN)
1060 {
1061 check( "RTL_TEXTENCODING_APPLE_ROMAN", RTL_TEXTENCODING_APPLE_ROMAN );
1062 }
1063 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_IBM_437)1064 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_IBM_437)
1065 {
1066 check( "RTL_TEXTENCODING_IBM_437", RTL_TEXTENCODING_IBM_437 );
1067 }
1068 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_IBM_850)1069 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_IBM_850)
1070 {
1071 check( "RTL_TEXTENCODING_IBM_850", RTL_TEXTENCODING_IBM_850 );
1072 }
1073 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_IBM_860)1074 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_IBM_860)
1075 {
1076 check( "RTL_TEXTENCODING_IBM_860", RTL_TEXTENCODING_IBM_860 );
1077 }
1078 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_IBM_861)1079 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_IBM_861)
1080 {
1081 check( "RTL_TEXTENCODING_IBM_861", RTL_TEXTENCODING_IBM_861 );
1082 }
1083 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_IBM_863)1084 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_IBM_863)
1085 {
1086 check( "RTL_TEXTENCODING_IBM_863", RTL_TEXTENCODING_IBM_863 );
1087 }
1088 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_IBM_865)1089 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_IBM_865)
1090 {
1091 check( "RTL_TEXTENCODING_IBM_865", RTL_TEXTENCODING_IBM_865 );
1092 }
1093 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_SYMBOL)1094 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_SYMBOL)
1095 {
1096 check( "RTL_TEXTENCODING_SYMBOL", RTL_TEXTENCODING_SYMBOL );
1097 }
1098 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_ASCII_US)1099 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_ASCII_US)
1100 {
1101 check( "RTL_TEXTENCODING_ASCII_US", RTL_TEXTENCODING_ASCII_US );
1102 }
1103 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_ISO_8859_1)1104 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_ISO_8859_1)
1105 {
1106 check( "RTL_TEXTENCODING_ISO_8859_1", RTL_TEXTENCODING_ISO_8859_1 );
1107 }
1108 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_ISO_8859_2)1109 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_ISO_8859_2)
1110 {
1111 check( "RTL_TEXTENCODING_ISO_8859_2", RTL_TEXTENCODING_ISO_8859_2 );
1112 }
1113 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_ISO_8859_3)1114 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_ISO_8859_3)
1115 {
1116 check( "RTL_TEXTENCODING_ISO_8859_3", RTL_TEXTENCODING_ISO_8859_3 );
1117 }
1118 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_ISO_8859_4)1119 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_ISO_8859_4)
1120 {
1121 check( "RTL_TEXTENCODING_ISO_8859_4", RTL_TEXTENCODING_ISO_8859_4 );
1122 }
1123 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_ISO_8859_5)1124 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_ISO_8859_5)
1125 {
1126 check( "RTL_TEXTENCODING_ISO_8859_5", RTL_TEXTENCODING_ISO_8859_5 );
1127 }
1128 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_ISO_8859_6)1129 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_ISO_8859_6)
1130 {
1131 check( "RTL_TEXTENCODING_ISO_8859_6", RTL_TEXTENCODING_ISO_8859_6 );
1132 }
1133 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_ISO_8859_7)1134 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_ISO_8859_7)
1135 {
1136 check( "RTL_TEXTENCODING_ISO_8859_7", RTL_TEXTENCODING_ISO_8859_7 );
1137 }
1138 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_ISO_8859_8)1139 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_ISO_8859_8)
1140 {
1141 check( "RTL_TEXTENCODING_ISO_8859_8", RTL_TEXTENCODING_ISO_8859_8 );
1142 }
1143 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_ISO_8859_9)1144 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_ISO_8859_9)
1145 {
1146 check( "RTL_TEXTENCODING_ISO_8859_9", RTL_TEXTENCODING_ISO_8859_9 );
1147 }
1148 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_ISO_8859_14)1149 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_ISO_8859_14)
1150 {
1151 check( "RTL_TEXTENCODING_ISO_8859_14", RTL_TEXTENCODING_ISO_8859_14 );
1152 }
1153 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_ISO_8859_15)1154 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_ISO_8859_15)
1155 {
1156 check( "RTL_TEXTENCODING_ISO_8859_15", RTL_TEXTENCODING_ISO_8859_15 );
1157 }
1158 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_IBM_737)1159 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_IBM_737)
1160 {
1161 check( "RTL_TEXTENCODING_IBM_737", RTL_TEXTENCODING_IBM_737 );
1162 }
1163 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_IBM_775)1164 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_IBM_775)
1165 {
1166 check( "RTL_TEXTENCODING_IBM_775", RTL_TEXTENCODING_IBM_775 );
1167 }
1168 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_IBM_852)1169 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_IBM_852)
1170 {
1171 check( "RTL_TEXTENCODING_IBM_852", RTL_TEXTENCODING_IBM_852 );
1172 }
1173 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_IBM_855)1174 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_IBM_855)
1175 {
1176 check( "RTL_TEXTENCODING_IBM_855", RTL_TEXTENCODING_IBM_855 );
1177 }
1178 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_IBM_857)1179 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_IBM_857)
1180 {
1181 check( "RTL_TEXTENCODING_IBM_857", RTL_TEXTENCODING_IBM_857 );
1182 }
1183 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_IBM_862)1184 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_IBM_862)
1185 {
1186 check( "RTL_TEXTENCODING_IBM_862", RTL_TEXTENCODING_IBM_862 );
1187 }
1188 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_IBM_864)1189 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_IBM_864)
1190 {
1191 check( "RTL_TEXTENCODING_IBM_864", RTL_TEXTENCODING_IBM_864 );
1192 }
1193 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_IBM_866)1194 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_IBM_866)
1195 {
1196 check( "RTL_TEXTENCODING_IBM_866", RTL_TEXTENCODING_IBM_866 );
1197 }
1198 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_IBM_869)1199 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_IBM_869)
1200 {
1201 check( "RTL_TEXTENCODING_IBM_869", RTL_TEXTENCODING_IBM_869 );
1202 }
1203 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_MS_874)1204 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_MS_874)
1205 {
1206 check( "RTL_TEXTENCODING_MS_874", RTL_TEXTENCODING_MS_874 );
1207 }
1208 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_MS_1250)1209 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_MS_1250)
1210 {
1211 check( "RTL_TEXTENCODING_MS_1250", RTL_TEXTENCODING_MS_1250 );
1212 }
1213 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_MS_1251)1214 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_MS_1251)
1215 {
1216 check( "RTL_TEXTENCODING_MS_1251", RTL_TEXTENCODING_MS_1251 );
1217 }
1218 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_MS_1253)1219 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_MS_1253)
1220 {
1221 check( "RTL_TEXTENCODING_MS_1253", RTL_TEXTENCODING_MS_1253 );
1222 }
1223 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_MS_1254)1224 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_MS_1254)
1225 {
1226 check( "RTL_TEXTENCODING_MS_1254", RTL_TEXTENCODING_MS_1254 );
1227 }
1228 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_MS_1255)1229 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_MS_1255)
1230 {
1231 check( "RTL_TEXTENCODING_MS_1255", RTL_TEXTENCODING_MS_1255 );
1232 }
1233 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_MS_1256)1234 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_MS_1256)
1235 {
1236 check( "RTL_TEXTENCODING_MS_1256", RTL_TEXTENCODING_MS_1256 );
1237 }
1238 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_MS_1257)1239 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_MS_1257)
1240 {
1241 check( "RTL_TEXTENCODING_MS_1257", RTL_TEXTENCODING_MS_1257 );
1242 }
1243 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_MS_1258)1244 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_MS_1258)
1245 {
1246 check( "RTL_TEXTENCODING_MS_1258", RTL_TEXTENCODING_MS_1258 );
1247 }
1248 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_ARABIC)1249 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_ARABIC)
1250 {
1251 check( "RTL_TEXTENCODING_APPLE_ARABIC", RTL_TEXTENCODING_APPLE_ARABIC );
1252 }
1253 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_CENTEURO)1254 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_CENTEURO)
1255 {
1256 check( "RTL_TEXTENCODING_APPLE_CENTEURO", RTL_TEXTENCODING_APPLE_CENTEURO );
1257 }
1258 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_CROATIAN)1259 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_CROATIAN)
1260 {
1261 check( "RTL_TEXTENCODING_APPLE_CROATIAN", RTL_TEXTENCODING_APPLE_CROATIAN );
1262 }
1263 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_CYRILLIC)1264 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_CYRILLIC)
1265 {
1266 check( "RTL_TEXTENCODING_APPLE_CYRILLIC", RTL_TEXTENCODING_APPLE_CYRILLIC );
1267 }
1268 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_DEVANAGARI)1269 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_DEVANAGARI)
1270 {
1271 check( "RTL_TEXTENCODING_APPLE_DEVANAGARI", RTL_TEXTENCODING_APPLE_DEVANAGARI );
1272 }
1273 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_FARSI)1274 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_FARSI)
1275 {
1276 check( "RTL_TEXTENCODING_APPLE_FARSI", RTL_TEXTENCODING_APPLE_FARSI );
1277 }
1278 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_GREEK)1279 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_GREEK)
1280 {
1281 check( "RTL_TEXTENCODING_APPLE_GREEK", RTL_TEXTENCODING_APPLE_GREEK );
1282 }
1283 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_GUJARATI)1284 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_GUJARATI)
1285 {
1286 check( "RTL_TEXTENCODING_APPLE_GUJARATI", RTL_TEXTENCODING_APPLE_GUJARATI );
1287 }
1288 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_GURMUKHI)1289 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_GURMUKHI)
1290 {
1291 check( "RTL_TEXTENCODING_APPLE_GURMUKHI", RTL_TEXTENCODING_APPLE_GURMUKHI );
1292 }
1293 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_HEBREW)1294 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_HEBREW)
1295 {
1296 check( "RTL_TEXTENCODING_APPLE_HEBREW", RTL_TEXTENCODING_APPLE_HEBREW );
1297 }
1298 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_ICELAND)1299 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_ICELAND)
1300 {
1301 check( "RTL_TEXTENCODING_APPLE_ICELAND", RTL_TEXTENCODING_APPLE_ICELAND );
1302 }
1303 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_ROMANIAN)1304 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_ROMANIAN)
1305 {
1306 check( "RTL_TEXTENCODING_APPLE_ROMANIAN", RTL_TEXTENCODING_APPLE_ROMANIAN );
1307 }
1308 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_THAI)1309 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_THAI)
1310 {
1311 check( "RTL_TEXTENCODING_APPLE_THAI", RTL_TEXTENCODING_APPLE_THAI );
1312 }
1313 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_TURKISH)1314 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_TURKISH)
1315 {
1316 check( "RTL_TEXTENCODING_APPLE_TURKISH", RTL_TEXTENCODING_APPLE_TURKISH );
1317 }
1318 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_UKRAINIAN)1319 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_UKRAINIAN)
1320 {
1321 check( "RTL_TEXTENCODING_APPLE_UKRAINIAN", RTL_TEXTENCODING_APPLE_UKRAINIAN );
1322 }
1323 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_CHINSIMP)1324 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_CHINSIMP)
1325 {
1326 check( "RTL_TEXTENCODING_APPLE_CHINSIMP", RTL_TEXTENCODING_APPLE_CHINSIMP );
1327 }
1328 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_CHINTRAD)1329 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_CHINTRAD)
1330 {
1331 check( "RTL_TEXTENCODING_APPLE_CHINTRAD", RTL_TEXTENCODING_APPLE_CHINTRAD );
1332 }
1333 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_JAPANESE)1334 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_JAPANESE)
1335 {
1336 check( "RTL_TEXTENCODING_APPLE_JAPANESE", RTL_TEXTENCODING_APPLE_JAPANESE );
1337 }
1338 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_APPLE_KOREAN)1339 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_APPLE_KOREAN)
1340 {
1341 check( "RTL_TEXTENCODING_APPLE_KOREAN", RTL_TEXTENCODING_APPLE_KOREAN );
1342 }
1343 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_MS_932)1344 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_MS_932)
1345 {
1346 check( "RTL_TEXTENCODING_MS_932", RTL_TEXTENCODING_MS_932 );
1347 }
1348 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_MS_936)1349 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_MS_936)
1350 {
1351 check( "RTL_TEXTENCODING_MS_936", RTL_TEXTENCODING_MS_936 );
1352 }
1353 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_MS_949)1354 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_MS_949)
1355 {
1356 check( "RTL_TEXTENCODING_MS_949", RTL_TEXTENCODING_MS_949 );
1357 }
1358 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_MS_950)1359 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_MS_950)
1360 {
1361 check( "RTL_TEXTENCODING_MS_950", RTL_TEXTENCODING_MS_950 );
1362 }
1363 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_SHIFT_JIS)1364 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_SHIFT_JIS)
1365 {
1366 check( "RTL_TEXTENCODING_SHIFT_JIS", RTL_TEXTENCODING_SHIFT_JIS );
1367 }
1368 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_GB_2312)1369 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_GB_2312)
1370 {
1371 check( "RTL_TEXTENCODING_GB_2312", RTL_TEXTENCODING_GB_2312 );
1372 }
1373 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_GBT_12345)1374 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_GBT_12345)
1375 {
1376 check( "RTL_TEXTENCODING_GBT_12345", RTL_TEXTENCODING_GBT_12345 );
1377 }
1378 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_GBK)1379 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_GBK)
1380 {
1381 check( "RTL_TEXTENCODING_GBK", RTL_TEXTENCODING_GBK );
1382 }
1383 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_BIG5)1384 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_BIG5)
1385 {
1386 check( "RTL_TEXTENCODING_BIG5", RTL_TEXTENCODING_BIG5 );
1387 }
1388 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_EUC_JP)1389 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_EUC_JP)
1390 {
1391 check( "RTL_TEXTENCODING_EUC_JP", RTL_TEXTENCODING_EUC_JP );
1392 }
1393 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_EUC_CN)1394 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_EUC_CN)
1395 {
1396 check( "RTL_TEXTENCODING_EUC_CN", RTL_TEXTENCODING_EUC_CN );
1397 }
1398 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_EUC_TW)1399 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_EUC_TW)
1400 {
1401 check( "RTL_TEXTENCODING_EUC_TW", RTL_TEXTENCODING_EUC_TW );
1402 }
1403 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_ISO_2022_JP)1404 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_ISO_2022_JP)
1405 {
1406 check( "RTL_TEXTENCODING_ISO_2022_JP", RTL_TEXTENCODING_ISO_2022_JP );
1407 }
1408 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_ISO_2022_CN)1409 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_ISO_2022_CN)
1410 {
1411 check( "RTL_TEXTENCODING_ISO_2022_CN", RTL_TEXTENCODING_ISO_2022_CN );
1412 }
1413 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_KOI8_R)1414 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_KOI8_R)
1415 {
1416 check( "RTL_TEXTENCODING_KOI8_R", RTL_TEXTENCODING_KOI8_R );
1417 }
1418 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_UTF7)1419 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_UTF7)
1420 {
1421 check( "RTL_TEXTENCODING_UTF7", RTL_TEXTENCODING_UTF7 );
1422 }
1423 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_UTF8)1424 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_UTF8)
1425 {
1426 check( "RTL_TEXTENCODING_UTF8", RTL_TEXTENCODING_UTF8 );
1427 }
1428 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_ISO_8859_10)1429 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_ISO_8859_10)
1430 {
1431 check( "RTL_TEXTENCODING_ISO_8859_10", RTL_TEXTENCODING_ISO_8859_10 );
1432 }
1433 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_ISO_8859_13)1434 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_ISO_8859_13)
1435 {
1436 check( "RTL_TEXTENCODING_ISO_8859_13", RTL_TEXTENCODING_ISO_8859_13 );
1437 }
1438 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_EUC_KR)1439 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_EUC_KR)
1440 {
1441 check( "RTL_TEXTENCODING_EUC_KR", RTL_TEXTENCODING_EUC_KR );
1442 }
1443 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_ISO_2022_KR)1444 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_ISO_2022_KR)
1445 {
1446 check( "RTL_TEXTENCODING_ISO_2022_KR", RTL_TEXTENCODING_ISO_2022_KR );
1447 }
1448 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_JIS_X_0201)1449 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_JIS_X_0201)
1450 {
1451 check( "RTL_TEXTENCODING_JIS_X_0201", RTL_TEXTENCODING_JIS_X_0201 );
1452 }
1453 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_JIS_X_0208)1454 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_JIS_X_0208)
1455 {
1456 check( "RTL_TEXTENCODING_JIS_X_0208", RTL_TEXTENCODING_JIS_X_0208 );
1457 }
1458 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_JIS_X_0212)1459 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_JIS_X_0212)
1460 {
1461 check( "RTL_TEXTENCODING_JIS_X_0212", RTL_TEXTENCODING_JIS_X_0212 );
1462 }
1463 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_MS_1361)1464 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_MS_1361)
1465 {
1466 check( "RTL_TEXTENCODING_MS_1361", RTL_TEXTENCODING_MS_1361 );
1467 }
1468 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_GB_18030)1469 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_GB_18030)
1470 {
1471 check( "RTL_TEXTENCODING_GB_18030", RTL_TEXTENCODING_GB_18030 );
1472 }
1473 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_BIG5_HKSCS)1474 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_BIG5_HKSCS)
1475 {
1476 check( "RTL_TEXTENCODING_BIG5_HKSCS", RTL_TEXTENCODING_BIG5_HKSCS );
1477 }
1478 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_TIS_620)1479 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_TIS_620)
1480 {
1481 check( "RTL_TEXTENCODING_TIS_620", RTL_TEXTENCODING_TIS_620 );
1482 }
1483 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_KOI8_U)1484 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_KOI8_U)
1485 {
1486 check( "RTL_TEXTENCODING_KOI8_U", RTL_TEXTENCODING_KOI8_U );
1487 }
1488 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_ISCII_DEVANAGARI)1489 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_ISCII_DEVANAGARI)
1490 {
1491 check( "RTL_TEXTENCODING_ISCII_DEVANAGARI", RTL_TEXTENCODING_ISCII_DEVANAGARI );
1492 }
1493 // ----------------------------------------
TEST_F(getBestWindows,WindowsCharsetFromTextEncoding_JAVA_UTF8)1494 TEST_F(getBestWindows, WindowsCharsetFromTextEncoding_JAVA_UTF8)
1495 {
1496 check( "RTL_TEXTENCODING_JAVA_UTF8", RTL_TEXTENCODING_JAVA_UTF8 );
1497 }
1498 // ----------------------------------------
1499
1500
1501 class getTextEncodingInfo: public ::testing::Test
1502 {
1503 public:
1504 // initialise your test code values here.
SetUp()1505 void SetUp()
1506 {
1507 }
1508
TearDown()1509 void TearDown()
1510 {
1511 }
1512 };
1513
1514
1515 // not implemented encoding test
TEST_F(getTextEncodingInfo,getTextEncodingInfo_001)1516 TEST_F(getTextEncodingInfo, getTextEncodingInfo_001)
1517 {
1518 rtl_TextEncodingInfo aInfo1, aInfo2, aInfo3, aInfo4, aInfo5;
1519 aInfo1.StructSize = 4;
1520 // not implemented
1521 sal_Bool bRes1 = rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_ARABIC, &aInfo1 );
1522 // implemented
1523 sal_Bool bRes11 = rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_CYRILLIC, &aInfo1 );
1524 ASSERT_TRUE(bRes1 == sal_False && bRes11 == sal_False) << "should return sal_False.";
1525
1526 aInfo2.StructSize = 5;
1527 sal_Bool bRes2 = rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_ARABIC, &aInfo2 );
1528 sal_Bool bRes21 = rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_CYRILLIC, &aInfo2 );
1529 ASSERT_TRUE(bRes2 == sal_True && bRes21 == sal_True && aInfo2.MinimumCharSize >=1) << "StructSize<6 should return sal_True";
1530
1531 aInfo3.StructSize = 6;
1532 sal_Bool bRes3 = rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_ARABIC, &aInfo3 );
1533 sal_Bool bRes31 = rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_CYRILLIC, &aInfo3 );
1534 ASSERT_TRUE(bRes3 == sal_True && bRes31 == sal_True) << "StructSize<6 should return sal_True";
1535 //&& aInfo2.MinimumCharSize >=1 );
1536
1537 aInfo4.StructSize = 8;
1538 sal_Bool bRes4 = rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_ARABIC, &aInfo4 );
1539 sal_Bool bRes41 = rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_CYRILLIC, &aInfo4);
1540 ASSERT_TRUE(bRes4 == sal_True && bRes41 == sal_True) << "StructSize<6 should return sal_True";
1541 // && aInfo2.MinimumCharSize >=1 );
1542
1543 aInfo5.StructSize = sizeof aInfo5;
1544 sal_Bool bRes5 = rtl_getTextEncodingInfo( RTL_TEXTENCODING_APPLE_ARABIC, &aInfo5 );
1545 ASSERT_TRUE(bRes5 == sal_False && aInfo5.Flags == 0) << "StructSize<6 should return sal_True";
1546 }
1547 }
1548
1549 namespace {
1550
1551 class TestEncodingFromUnix: public ::testing::Test {
1552 protected:
check(rtl_TextEncoding expected,char const * input)1553 void check(rtl_TextEncoding expected, char const * input) {
1554 ASSERT_EQ(
1555 expected, rtl_getTextEncodingFromUnixCharset(input)) << input;
1556 }
1557 };
1558
TEST_F(TestEncodingFromUnix,testIso8859)1559 TEST_F(TestEncodingFromUnix, testIso8859) {
1560 check(RTL_TEXTENCODING_DONTKNOW, "ISO8859");
1561 check(RTL_TEXTENCODING_DONTKNOW, "ISO8859-0");
1562 check(RTL_TEXTENCODING_DONTKNOW, "ISO8859-01");
1563 check(RTL_TEXTENCODING_DONTKNOW, "ISO8859_1");
1564 check(RTL_TEXTENCODING_DONTKNOW, "ISO88591");
1565 check(RTL_TEXTENCODING_ISO_8859_1, "ISO8859-1");
1566 check(RTL_TEXTENCODING_ISO_8859_2, "ISO8859-2");
1567 check(RTL_TEXTENCODING_ISO_8859_3, "ISO8859-3");
1568 check(RTL_TEXTENCODING_ISO_8859_4, "ISO8859-4");
1569 check(RTL_TEXTENCODING_ISO_8859_5, "ISO8859-5");
1570 check(RTL_TEXTENCODING_ISO_8859_6, "ISO8859-6");
1571 check(RTL_TEXTENCODING_ISO_8859_7, "ISO8859-7");
1572 check(RTL_TEXTENCODING_ISO_8859_8, "ISO8859-8");
1573 check(RTL_TEXTENCODING_ISO_8859_9, "ISO8859-9");
1574 check(RTL_TEXTENCODING_ISO_8859_10, "ISO8859-10");
1575 check(RTL_TEXTENCODING_TIS_620, "ISO8859-11");
1576 check(RTL_TEXTENCODING_ISO_8859_13, "ISO8859-13");
1577 check(RTL_TEXTENCODING_ISO_8859_14, "ISO8859-14");
1578 check(RTL_TEXTENCODING_ISO_8859_15, "ISO8859-15");
1579 }
1580
TEST_F(TestEncodingFromUnix,testTis620)1581 TEST_F(TestEncodingFromUnix, testTis620) {
1582 check(RTL_TEXTENCODING_DONTKNOW, "TIS620");
1583 check(RTL_TEXTENCODING_TIS_620, "TIS620-0");
1584 check(RTL_TEXTENCODING_DONTKNOW, "TIS620-1");
1585 check(RTL_TEXTENCODING_TIS_620, "TIS620-2529");
1586 check(RTL_TEXTENCODING_TIS_620, "TIS620-2533");
1587 check(RTL_TEXTENCODING_DONTKNOW, "TIS620.2529-0");
1588 check(RTL_TEXTENCODING_TIS_620, "TIS620.2529-1");
1589 check(RTL_TEXTENCODING_DONTKNOW, "TIS620.2529-2");
1590 check(RTL_TEXTENCODING_TIS_620, "TIS620.2533-0");
1591 check(RTL_TEXTENCODING_TIS_620, "TIS620.2533-1");
1592 check(RTL_TEXTENCODING_DONTKNOW, "TIS620.2533-2");
1593 }
1594
1595 }
1596
main(int argc,char ** argv)1597 int main(int argc, char **argv)
1598 {
1599 ::testing::InitGoogleTest(&argc, argv);
1600 return RUN_ALL_TESTS();
1601 }
1602