1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "sal/config.h"
25 #include "rtl/tencinfo.h"
27 #include "gettextencodingdata.hxx"
28 #include "tenchelp.hxx"
29 #include <boost/scoped_array.hpp>
31 sal_Bool SAL_CALL
rtl_isOctetTextEncoding(rtl_TextEncoding nEncoding
)
34 nEncoding
> RTL_TEXTENCODING_DONTKNOW
35 && nEncoding
!= 9 // RTL_TEXTENCODING_SYSTEM
36 && nEncoding
<= RTL_TEXTENCODING_ADOBE_DINGBATS
; // always update this!
39 /* ======================================================================= */
41 static void Impl_toAsciiLower( const char* pName
, char* pBuf
)
46 if ( (*pName
>= 0x41) && (*pName
<= 0x5A) )
47 *pBuf
= (*pName
)+0x20; /* toAsciiLower */
58 /* ----------------------------------------------------------------------- */
60 static void Impl_toAsciiLowerAndRemoveNonAlphanumeric( const char* pName
, char* pBuf
)
65 if ( (*pName
>= 0x41) && (*pName
<= 0x5A) )
67 *pBuf
= (*pName
)+0x20; /* toAsciiLower */
71 else if ( ((*pName
>= 0x61) && (*pName
<= 0x7A)) ||
72 ((*pName
>= 0x30) && (*pName
<= 0x39)) )
84 /* ----------------------------------------------------------------------- */
86 /* pMatchStr must match with all characters in pCompStr */
87 static bool Impl_matchString( const char* pCompStr
, const char* pMatchStr
)
89 /* We test only for end in MatchStr, because the last 0 character from */
90 /* pCompStr is unequal a character in MatchStr, so the loop terminates */
93 if ( *pCompStr
!= *pMatchStr
)
103 /* ======================================================================= */
105 struct ImplStrCharsetDef
107 const char* mpCharsetStr
;
108 rtl_TextEncoding meTextEncoding
;
111 struct ImplStrFirstPartCharsetDef
113 const char* mpCharsetStr
;
114 const ImplStrCharsetDef
* mpSecondPartTab
;
117 /* ======================================================================= */
119 sal_Bool SAL_CALL
rtl_getTextEncodingInfo( rtl_TextEncoding eTextEncoding
, rtl_TextEncodingInfo
* pEncInfo
)
121 const ImplTextEncodingData
* pData
;
123 pData
= Impl_getTextEncodingData( eTextEncoding
);
126 /* HACK: For not implemented encoding, because not all
127 calls handle the errors */
128 if ( pEncInfo
->StructSize
< 5 )
130 pEncInfo
->MinimumCharSize
= 1;
132 if ( pEncInfo
->StructSize
< 6 )
134 pEncInfo
->MaximumCharSize
= 1;
136 if ( pEncInfo
->StructSize
< 7 )
138 pEncInfo
->AverageCharSize
= 1;
140 if ( pEncInfo
->StructSize
< 12 )
147 if ( pEncInfo
->StructSize
< 5 )
149 pEncInfo
->MinimumCharSize
= pData
->mnMinCharSize
;
151 if ( pEncInfo
->StructSize
< 6 )
153 pEncInfo
->MaximumCharSize
= pData
->mnMaxCharSize
;
155 if ( pEncInfo
->StructSize
< 7 )
157 pEncInfo
->AverageCharSize
= pData
->mnAveCharSize
;
159 if ( pEncInfo
->StructSize
< 12 )
161 pEncInfo
->Flags
= pData
->mnInfoFlags
;
166 /* ======================================================================= */
168 rtl_TextEncoding SAL_CALL
rtl_getTextEncodingFromWindowsCharset( sal_uInt8 nWinCharset
)
170 rtl_TextEncoding eTextEncoding
;
172 switch ( nWinCharset
)
174 case 0: eTextEncoding
= RTL_TEXTENCODING_MS_1252
; break; /* ANSI_CHARSET */
175 case 2: eTextEncoding
= RTL_TEXTENCODING_SYMBOL
; break; /* SYMBOL_CHARSET */
176 case 77: eTextEncoding
= RTL_TEXTENCODING_APPLE_ROMAN
; break;/* MAC_CHARSET */
177 case 128: eTextEncoding
= RTL_TEXTENCODING_MS_932
; break; /* SHIFTJIS_CHARSET */
178 case 129: eTextEncoding
= RTL_TEXTENCODING_MS_949
; break; /* HANGEUL_CHARSET */
179 case 130: eTextEncoding
= RTL_TEXTENCODING_MS_1361
; break; /* JOHAB_CHARSET */
180 case 134: eTextEncoding
= RTL_TEXTENCODING_MS_936
; break; /* GB2312_CHARSET */
181 case 136: eTextEncoding
= RTL_TEXTENCODING_MS_950
; break; /* CHINESEBIG5_CHARSET */
182 case 161: eTextEncoding
= RTL_TEXTENCODING_MS_1253
; break; /* GREEK_CHARSET */
183 case 162: eTextEncoding
= RTL_TEXTENCODING_MS_1254
; break; /* TURKISH_CHARSET */
184 case 163: eTextEncoding
= RTL_TEXTENCODING_MS_1258
; break; /* VIETNAMESE_CHARSET !!! */
185 case 177: eTextEncoding
= RTL_TEXTENCODING_MS_1255
; break; /* HEBREW_CHARSET */
186 case 178: eTextEncoding
= RTL_TEXTENCODING_MS_1256
; break; /* ARABIC_CHARSET */
187 case 186: eTextEncoding
= RTL_TEXTENCODING_MS_1257
; break; /* BALTIC_CHARSET */
188 case 204: eTextEncoding
= RTL_TEXTENCODING_MS_1251
; break; /* RUSSIAN_CHARSET */
189 case 222: eTextEncoding
= RTL_TEXTENCODING_MS_874
; break; /* THAI_CHARSET */
190 case 238: eTextEncoding
= RTL_TEXTENCODING_MS_1250
; break; /* EASTEUROPE_CHARSET */
191 case 255: eTextEncoding
= RTL_TEXTENCODING_IBM_850
; break; /* OEM_CHARSET */
192 default: eTextEncoding
= RTL_TEXTENCODING_DONTKNOW
; break;
195 return eTextEncoding
;
198 /* ----------------------------------------------------------------------- */
200 rtl_TextEncoding SAL_CALL
rtl_getTextEncodingFromUnixCharset( const char* pUnixCharset
)
202 /* See <ftp://ftp.x.org/pub/DOCS/registry>, section 14 ("Font Charset
203 * (Registry and Encoding) Names").
206 /* All Identifiers in the tables are lower case The function search */
207 /* for the first matching string in the tables. */
208 /* Sort order: unique (first 14, than 1), important */
210 static ImplStrCharsetDef
const aUnixCharsetISOTab
[] =
212 { "15", RTL_TEXTENCODING_ISO_8859_15
},
213 { "14", RTL_TEXTENCODING_ISO_8859_14
},
214 { "13", RTL_TEXTENCODING_ISO_8859_13
},
215 { "11", RTL_TEXTENCODING_TIS_620
},
216 { "10", RTL_TEXTENCODING_ISO_8859_10
},
217 { "1", RTL_TEXTENCODING_ISO_8859_1
},
218 { "2", RTL_TEXTENCODING_ISO_8859_2
},
219 { "3", RTL_TEXTENCODING_ISO_8859_3
},
220 { "4", RTL_TEXTENCODING_ISO_8859_4
},
221 { "5", RTL_TEXTENCODING_ISO_8859_5
},
222 { "6", RTL_TEXTENCODING_ISO_8859_6
},
223 { "7", RTL_TEXTENCODING_ISO_8859_7
},
224 { "8", RTL_TEXTENCODING_ISO_8859_8
},
225 { "9", RTL_TEXTENCODING_ISO_8859_9
},
226 { NULL
, RTL_TEXTENCODING_DONTKNOW
}
229 static ImplStrCharsetDef
const aUnixCharsetADOBETab
[] =
231 { "fontspecific", RTL_TEXTENCODING_SYMBOL
},
232 { NULL
, RTL_TEXTENCODING_DONTKNOW
}
235 static ImplStrCharsetDef
const aUnixCharsetMSTab
[] =
237 { "1252", RTL_TEXTENCODING_MS_1252
},
238 { "1250", RTL_TEXTENCODING_MS_1250
},
239 { "1251", RTL_TEXTENCODING_MS_1251
},
240 { "1253", RTL_TEXTENCODING_MS_1253
},
241 { "1254", RTL_TEXTENCODING_MS_1254
},
242 { "1255", RTL_TEXTENCODING_MS_1255
},
243 { "1256", RTL_TEXTENCODING_MS_1256
},
244 { "1257", RTL_TEXTENCODING_MS_1257
},
245 { "1258", RTL_TEXTENCODING_MS_1258
},
246 { "932", RTL_TEXTENCODING_MS_932
},
247 { "936", RTL_TEXTENCODING_MS_936
},
248 { "949", RTL_TEXTENCODING_MS_949
},
249 { "950", RTL_TEXTENCODING_MS_950
},
250 { "1361", RTL_TEXTENCODING_MS_1361
},
251 { "cp1252", RTL_TEXTENCODING_MS_1252
},
252 { "cp1250", RTL_TEXTENCODING_MS_1250
},
253 { "cp1251", RTL_TEXTENCODING_MS_1251
},
254 { "cp1253", RTL_TEXTENCODING_MS_1253
},
255 { "cp1254", RTL_TEXTENCODING_MS_1254
},
256 { "cp1255", RTL_TEXTENCODING_MS_1255
},
257 { "cp1256", RTL_TEXTENCODING_MS_1256
},
258 { "cp1257", RTL_TEXTENCODING_MS_1257
},
259 { "cp1258", RTL_TEXTENCODING_MS_1258
},
260 { "cp932", RTL_TEXTENCODING_MS_932
},
261 { "cp936", RTL_TEXTENCODING_MS_936
},
262 { "cp949", RTL_TEXTENCODING_MS_949
},
263 { "cp950", RTL_TEXTENCODING_MS_950
},
264 { "cp1361", RTL_TEXTENCODING_MS_1361
},
265 { NULL
, RTL_TEXTENCODING_DONTKNOW
}
268 static ImplStrCharsetDef
const aUnixCharsetIBMTab
[] =
270 { "437", RTL_TEXTENCODING_IBM_437
},
271 { "850", RTL_TEXTENCODING_IBM_850
},
272 { "860", RTL_TEXTENCODING_IBM_860
},
273 { "861", RTL_TEXTENCODING_IBM_861
},
274 { "863", RTL_TEXTENCODING_IBM_863
},
275 { "865", RTL_TEXTENCODING_IBM_865
},
276 { "737", RTL_TEXTENCODING_IBM_737
},
277 { "775", RTL_TEXTENCODING_IBM_775
},
278 { "852", RTL_TEXTENCODING_IBM_852
},
279 { "855", RTL_TEXTENCODING_IBM_855
},
280 { "857", RTL_TEXTENCODING_IBM_857
},
281 { "862", RTL_TEXTENCODING_IBM_862
},
282 { "864", RTL_TEXTENCODING_IBM_864
},
283 { "866", RTL_TEXTENCODING_IBM_866
},
284 { "869", RTL_TEXTENCODING_IBM_869
},
285 { "874", RTL_TEXTENCODING_MS_874
},
286 { "1004", RTL_TEXTENCODING_MS_1252
},
287 { "65400", RTL_TEXTENCODING_SYMBOL
},
288 { NULL
, RTL_TEXTENCODING_DONTKNOW
}
291 static ImplStrCharsetDef
const aUnixCharsetKOI8Tab
[] =
293 { "r", RTL_TEXTENCODING_KOI8_R
},
294 { "u", RTL_TEXTENCODING_KOI8_U
},
295 { NULL
, RTL_TEXTENCODING_DONTKNOW
}
298 static ImplStrCharsetDef
const aUnixCharsetJISX0208Tab
[] =
300 { NULL
, RTL_TEXTENCODING_JIS_X_0208
}
303 static ImplStrCharsetDef
const aUnixCharsetJISX0201Tab
[] =
305 { NULL
, RTL_TEXTENCODING_JIS_X_0201
}
308 static ImplStrCharsetDef
const aUnixCharsetJISX0212Tab
[] =
310 { NULL
, RTL_TEXTENCODING_JIS_X_0212
}
313 static ImplStrCharsetDef
const aUnixCharsetGBTab
[] =
315 { NULL
, RTL_TEXTENCODING_GB_2312
}
318 static ImplStrCharsetDef
const aUnixCharsetGBKTab
[] =
320 { NULL
, RTL_TEXTENCODING_GBK
}
323 static ImplStrCharsetDef
const aUnixCharsetBIG5Tab
[] =
325 { NULL
, RTL_TEXTENCODING_BIG5
}
328 static ImplStrCharsetDef
const aUnixCharsetKSC56011987Tab
[] =
330 { NULL
, RTL_TEXTENCODING_EUC_KR
}
333 static ImplStrCharsetDef
const aUnixCharsetKSC56011992Tab
[] =
335 { NULL
, RTL_TEXTENCODING_MS_1361
}
338 static ImplStrCharsetDef
const aUnixCharsetISO10646Tab
[] =
340 { NULL
, RTL_TEXTENCODING_UNICODE
}
343 static ImplStrCharsetDef
const aUnixCharsetUNICODETab
[] =
345 /* Currently every Unicode Encoding is for us Unicode */
346 /* { "fontspecific", RTL_TEXTENCODING_UNICODE }, */
347 { NULL
, RTL_TEXTENCODING_UNICODE
}
350 static ImplStrCharsetDef
const aUnixCharsetSymbolTab
[] =
352 { NULL
, RTL_TEXTENCODING_SYMBOL
}
355 /* See <http://cvs.freedesktop.org/xorg/xc/fonts/encodings/iso8859-11.enc?
357 static ImplStrCharsetDef
const aUnixCharsetTIS620Tab
[] =
359 { "0", RTL_TEXTENCODING_TIS_620
},
360 { "2529", RTL_TEXTENCODING_TIS_620
},
361 { "2533", RTL_TEXTENCODING_TIS_620
},
362 { NULL
, RTL_TEXTENCODING_DONTKNOW
}
364 static ImplStrCharsetDef
const aUnixCharsetTIS6202529Tab
[] =
366 { "1", RTL_TEXTENCODING_TIS_620
},
367 { NULL
, RTL_TEXTENCODING_DONTKNOW
}
369 static ImplStrCharsetDef
const aUnixCharsetTIS6202533Tab
[] =
371 { "0", RTL_TEXTENCODING_TIS_620
},
372 { "1", RTL_TEXTENCODING_TIS_620
},
373 { NULL
, RTL_TEXTENCODING_DONTKNOW
}
376 static ImplStrFirstPartCharsetDef
const aUnixCharsetFirstPartTab
[] =
378 { "iso8859", aUnixCharsetISOTab
},
379 { "adobe", aUnixCharsetADOBETab
},
380 { "ansi", aUnixCharsetMSTab
},
381 { "microsoft", aUnixCharsetMSTab
},
382 { "ibm", aUnixCharsetIBMTab
},
383 { "koi8", aUnixCharsetKOI8Tab
},
384 { "jisx0208", aUnixCharsetJISX0208Tab
},
385 { "jisx0208.1983", aUnixCharsetJISX0208Tab
},
386 { "jisx0201", aUnixCharsetJISX0201Tab
},
387 { "jisx0201.1976", aUnixCharsetJISX0201Tab
},
388 { "jisx0212", aUnixCharsetJISX0212Tab
},
389 { "jisx0212.1990", aUnixCharsetJISX0212Tab
},
390 { "gb2312", aUnixCharsetGBTab
},
391 { "gbk", aUnixCharsetGBKTab
},
392 { "big5", aUnixCharsetBIG5Tab
},
393 { "iso10646", aUnixCharsetISO10646Tab
},
394 /* { "unicode", aUnixCharsetUNICODETab }, */ /* fonts contain only default chars */
395 { "sunolcursor", aUnixCharsetSymbolTab
},
396 { "sunolglyph", aUnixCharsetSymbolTab
},
397 { "iso10646", aUnixCharsetUNICODETab
},
398 { "ksc5601.1987", aUnixCharsetKSC56011987Tab
},
399 { "ksc5601.1992", aUnixCharsetKSC56011992Tab
},
400 { "tis620.2529", aUnixCharsetTIS6202529Tab
},
401 { "tis620.2533", aUnixCharsetTIS6202533Tab
},
402 { "tis620", aUnixCharsetTIS620Tab
},
403 /* { "sunudcja.1997", }, */
404 /* { "sunudcko.1997", }, */
405 /* { "sunudczh.1997", }, */
406 /* { "sunudczhtw.1997", }, */
410 rtl_TextEncoding eEncoding
= RTL_TEXTENCODING_DONTKNOW
;
412 sal_uInt32 nBufLen
= strlen( pUnixCharset
)+1;
413 const char* pFirstPart
;
414 const char* pSecondPart
;
416 /* Alloc Buffer and map to lower case */
417 boost::scoped_array
<char> pBuf(new char[nBufLen
]);
418 Impl_toAsciiLower( pUnixCharset
, pBuf
.get() );
420 /* Search FirstPart */
421 pFirstPart
= pBuf
.get();
423 pTempBuf
= pBuf
.get();
426 if ( *pTempBuf
== '-' )
429 pSecondPart
= pTempBuf
+1;
436 /* Parttrenner gefunden */
439 /* Search for the part tab */
440 const ImplStrFirstPartCharsetDef
* pFirstPartData
= aUnixCharsetFirstPartTab
;
441 while ( pFirstPartData
->mpCharsetStr
)
443 if ( Impl_matchString( pFirstPart
, pFirstPartData
->mpCharsetStr
) )
445 /* Search for the charset in the second part tab */
446 const ImplStrCharsetDef
* pData
= pFirstPartData
->mpSecondPartTab
;
447 while ( pData
->mpCharsetStr
)
449 if ( Impl_matchString( pSecondPart
, pData
->mpCharsetStr
) )
457 /* use default encoding for first part */
458 eEncoding
= pData
->meTextEncoding
;
469 /* ----------------------------------------------------------------------- */
471 rtl_TextEncoding SAL_CALL
rtl_getTextEncodingFromMimeCharset( const char* pMimeCharset
)
473 /* All Identifiers are in lower case and contain only alphanumeric */
474 /* characters. The function search for the first equal string in */
475 /* the table. In this table are only the most used mime types. */
476 /* Sort order: important */
477 static ImplStrCharsetDef
const aVIPMimeCharsetTab
[] =
479 { "usascii", RTL_TEXTENCODING_ASCII_US
},
480 { "utf8", RTL_TEXTENCODING_UTF8
},
481 { "utf7", RTL_TEXTENCODING_UTF7
},
482 { "iso88591", RTL_TEXTENCODING_ISO_8859_1
},
483 { "iso88592", RTL_TEXTENCODING_ISO_8859_2
},
484 { "iso88593", RTL_TEXTENCODING_ISO_8859_3
},
485 { "iso88594", RTL_TEXTENCODING_ISO_8859_4
},
486 { "iso88595", RTL_TEXTENCODING_ISO_8859_5
},
487 { "iso88596", RTL_TEXTENCODING_ISO_8859_6
},
488 { "iso88597", RTL_TEXTENCODING_ISO_8859_7
},
489 { "iso88598", RTL_TEXTENCODING_ISO_8859_8
},
490 { "iso88599", RTL_TEXTENCODING_ISO_8859_9
},
491 { "iso885910", RTL_TEXTENCODING_ISO_8859_10
},
492 { "iso885913", RTL_TEXTENCODING_ISO_8859_13
},
493 { "iso885914", RTL_TEXTENCODING_ISO_8859_14
},
494 { "iso885915", RTL_TEXTENCODING_ISO_8859_15
},
495 { "iso2022jp", RTL_TEXTENCODING_ISO_2022_JP
},
496 { "iso2022jp2", RTL_TEXTENCODING_ISO_2022_JP
},
497 { "iso2022cn", RTL_TEXTENCODING_ISO_2022_CN
},
498 { "iso2022cnext", RTL_TEXTENCODING_ISO_2022_CN
},
499 { "iso2022kr", RTL_TEXTENCODING_ISO_2022_KR
},
500 { "eucjp", RTL_TEXTENCODING_EUC_JP
},
501 { "shiftjis", RTL_TEXTENCODING_SHIFT_JIS
},
502 { "mskanji", RTL_TEXTENCODING_MS_932
},
503 { "gb2312", RTL_TEXTENCODING_GB_2312
},
504 { "cngb", RTL_TEXTENCODING_GB_2312
},
505 { "big5", RTL_TEXTENCODING_BIG5
},
506 { "cnbig5", RTL_TEXTENCODING_BIG5
},
507 { "cngb12345", RTL_TEXTENCODING_GBT_12345
},
508 { "euckr", RTL_TEXTENCODING_EUC_KR
},
509 { "koi8r", RTL_TEXTENCODING_KOI8_R
},
510 { "windows1252", RTL_TEXTENCODING_MS_1252
},
511 { "windows1250", RTL_TEXTENCODING_MS_1250
},
512 { "windows1251", RTL_TEXTENCODING_MS_1251
},
513 { "windows1253", RTL_TEXTENCODING_MS_1253
},
514 { "windows1254", RTL_TEXTENCODING_MS_1254
},
515 { "windows1255", RTL_TEXTENCODING_MS_1255
},
516 { "windows1256", RTL_TEXTENCODING_MS_1256
},
517 { "windows1257", RTL_TEXTENCODING_MS_1257
},
518 { "windows1258", RTL_TEXTENCODING_MS_1258
},
519 { NULL
, RTL_TEXTENCODING_DONTKNOW
}
522 /* All Identifiers are in lower case and contain only alphanumeric */
523 /* characters. The function search for the first matching string in */
525 /* Sort order: unique (first iso885914, than iso88591), important */
526 static ImplStrCharsetDef
const aMimeCharsetTab
[] =
528 { "unicode11utf7", RTL_TEXTENCODING_UTF7
},
529 { "caunicode11utf7", RTL_TEXTENCODING_UTF7
},
530 { "iso88591windows30", RTL_TEXTENCODING_ISO_8859_1
},
531 { "iso88591win", RTL_TEXTENCODING_MS_1252
},
532 { "iso88592win", RTL_TEXTENCODING_MS_1250
},
533 { "iso88599win", RTL_TEXTENCODING_MS_1254
},
534 { "iso885915", RTL_TEXTENCODING_ISO_8859_15
},
535 { "iso885914", RTL_TEXTENCODING_ISO_8859_14
},
536 { "iso885913", RTL_TEXTENCODING_ISO_8859_13
},
537 { "iso885911", RTL_TEXTENCODING_TIS_620
},
538 /* This is no official MIME character set name, but it might be in
540 { "iso885910", RTL_TEXTENCODING_ISO_8859_10
},
541 { "iso88591", RTL_TEXTENCODING_ISO_8859_1
},
542 { "iso88592", RTL_TEXTENCODING_ISO_8859_2
},
543 { "iso88593", RTL_TEXTENCODING_ISO_8859_3
},
544 { "iso88594", RTL_TEXTENCODING_ISO_8859_4
},
545 { "iso88595", RTL_TEXTENCODING_ISO_8859_5
},
546 { "iso88596", RTL_TEXTENCODING_ISO_8859_6
},
547 { "iso88597", RTL_TEXTENCODING_ISO_8859_7
},
548 { "iso88598", RTL_TEXTENCODING_ISO_8859_8
},
549 { "iso88599", RTL_TEXTENCODING_ISO_8859_9
},
550 { "isoir100", RTL_TEXTENCODING_ISO_8859_1
},
551 { "latin1", RTL_TEXTENCODING_ISO_8859_1
},
552 { "l1", RTL_TEXTENCODING_ISO_8859_1
},
553 { "cp819", RTL_TEXTENCODING_ISO_8859_1
},
554 { "ibm819", RTL_TEXTENCODING_ISO_8859_1
},
555 { "csisolatin1", RTL_TEXTENCODING_ISO_8859_1
},
556 { "isoir101", RTL_TEXTENCODING_ISO_8859_2
},
557 { "latin2", RTL_TEXTENCODING_ISO_8859_2
},
558 { "l2", RTL_TEXTENCODING_ISO_8859_2
},
559 { "csisolatin2", RTL_TEXTENCODING_ISO_8859_2
},
560 { "isoir109", RTL_TEXTENCODING_ISO_8859_3
},
561 { "latin3", RTL_TEXTENCODING_ISO_8859_3
},
562 { "l3", RTL_TEXTENCODING_ISO_8859_3
},
563 { "csisolatin3", RTL_TEXTENCODING_ISO_8859_3
},
564 { "isoir110", RTL_TEXTENCODING_ISO_8859_4
},
565 { "latin4", RTL_TEXTENCODING_ISO_8859_4
},
566 { "l4", RTL_TEXTENCODING_ISO_8859_4
},
567 { "csisolatin4", RTL_TEXTENCODING_ISO_8859_4
},
568 { "isoir144", RTL_TEXTENCODING_ISO_8859_5
},
569 { "cyrillicasian", RTL_TEXTENCODING_PT154
},
570 { "cyrillic", RTL_TEXTENCODING_ISO_8859_5
},
571 { "csisolatincyrillic", RTL_TEXTENCODING_ISO_8859_5
},
572 { "isoir127", RTL_TEXTENCODING_ISO_8859_6
},
573 { "arabic", RTL_TEXTENCODING_ISO_8859_6
},
574 { "csisolatinarabic", RTL_TEXTENCODING_ISO_8859_6
},
575 { "ecma114", RTL_TEXTENCODING_ISO_8859_6
},
576 { "asmo708", RTL_TEXTENCODING_ISO_8859_6
},
577 { "isoir126", RTL_TEXTENCODING_ISO_8859_7
},
578 { "greek", RTL_TEXTENCODING_ISO_8859_7
},
579 { "csisolatingreek", RTL_TEXTENCODING_ISO_8859_7
},
580 { "elot928", RTL_TEXTENCODING_ISO_8859_7
},
581 { "ecma118", RTL_TEXTENCODING_ISO_8859_7
},
582 { "isoir138", RTL_TEXTENCODING_ISO_8859_8
},
583 { "hebrew", RTL_TEXTENCODING_ISO_8859_8
},
584 { "csisolatinhebrew", RTL_TEXTENCODING_ISO_8859_8
},
585 { "isoir148", RTL_TEXTENCODING_ISO_8859_9
},
586 { "latin5", RTL_TEXTENCODING_ISO_8859_9
},
587 { "l5", RTL_TEXTENCODING_ISO_8859_9
},
588 { "csisolatin5", RTL_TEXTENCODING_ISO_8859_9
},
589 { "cswindows30latin1", RTL_TEXTENCODING_ISO_8859_1
},
590 { "cswindows30latin1", RTL_TEXTENCODING_ISO_8859_1
},
591 { "cswindows31latin1", RTL_TEXTENCODING_MS_1252
},
592 { "cswindows31latin2", RTL_TEXTENCODING_MS_1250
},
593 { "cswindows31latin5", RTL_TEXTENCODING_MS_1254
},
594 { "iso10646us", RTL_TEXTENCODING_ASCII_US
},
595 { "iso646irv", RTL_TEXTENCODING_ASCII_US
},
596 { "cskoi8r", RTL_TEXTENCODING_KOI8_R
},
597 { "ibm437", RTL_TEXTENCODING_IBM_437
},
598 { "cp437", RTL_TEXTENCODING_IBM_437
},
599 { "437", RTL_TEXTENCODING_IBM_437
},
600 { "cspc8codepage437", RTL_TEXTENCODING_IBM_437
},
601 { "ansix34", RTL_TEXTENCODING_ASCII_US
},
602 { "ibm367", RTL_TEXTENCODING_ASCII_US
},
603 { "cp367", RTL_TEXTENCODING_ASCII_US
},
604 { "csascii", RTL_TEXTENCODING_ASCII_US
},
605 { "ibm775", RTL_TEXTENCODING_IBM_775
},
606 { "cp775", RTL_TEXTENCODING_IBM_775
},
607 { "cspc775baltic", RTL_TEXTENCODING_IBM_775
},
608 { "ibm850", RTL_TEXTENCODING_IBM_850
},
609 { "cp850", RTL_TEXTENCODING_IBM_850
},
610 { "850", RTL_TEXTENCODING_IBM_850
},
611 { "cspc850multilingual", RTL_TEXTENCODING_IBM_850
},
612 /* { "ibm851", RTL_TEXTENCODING_IBM_851 }, */
613 /* { "cp851", RTL_TEXTENCODING_IBM_851 }, */
614 /* { "851", RTL_TEXTENCODING_IBM_851 }, */
615 /* { "csibm851", RTL_TEXTENCODING_IBM_851 }, */
616 { "ibm852", RTL_TEXTENCODING_IBM_852
},
617 { "cp852", RTL_TEXTENCODING_IBM_852
},
618 { "852", RTL_TEXTENCODING_IBM_852
},
619 { "cspcp852", RTL_TEXTENCODING_IBM_852
},
620 { "ibm855", RTL_TEXTENCODING_IBM_855
},
621 { "cp855", RTL_TEXTENCODING_IBM_855
},
622 { "855", RTL_TEXTENCODING_IBM_855
},
623 { "csibm855", RTL_TEXTENCODING_IBM_855
},
624 { "ibm857", RTL_TEXTENCODING_IBM_857
},
625 { "cp857", RTL_TEXTENCODING_IBM_857
},
626 { "857", RTL_TEXTENCODING_IBM_857
},
627 { "csibm857", RTL_TEXTENCODING_IBM_857
},
628 { "ibm860", RTL_TEXTENCODING_IBM_860
},
629 { "cp860", RTL_TEXTENCODING_IBM_860
},
630 { "860", RTL_TEXTENCODING_IBM_860
},
631 { "csibm860", RTL_TEXTENCODING_IBM_860
},
632 { "ibm861", RTL_TEXTENCODING_IBM_861
},
633 { "cp861", RTL_TEXTENCODING_IBM_861
},
634 { "861", RTL_TEXTENCODING_IBM_861
},
635 { "csis", RTL_TEXTENCODING_IBM_861
},
636 { "csibm861", RTL_TEXTENCODING_IBM_861
},
637 { "ibm862", RTL_TEXTENCODING_IBM_862
},
638 { "cp862", RTL_TEXTENCODING_IBM_862
},
639 { "862", RTL_TEXTENCODING_IBM_862
},
640 { "cspc862latinhebrew", RTL_TEXTENCODING_IBM_862
},
641 { "ibm863", RTL_TEXTENCODING_IBM_863
},
642 { "cp863", RTL_TEXTENCODING_IBM_863
},
643 { "863", RTL_TEXTENCODING_IBM_863
},
644 { "csibm863", RTL_TEXTENCODING_IBM_863
},
645 { "ibm864", RTL_TEXTENCODING_IBM_864
},
646 { "cp864", RTL_TEXTENCODING_IBM_864
},
647 { "864", RTL_TEXTENCODING_IBM_864
},
648 { "csibm864", RTL_TEXTENCODING_IBM_864
},
649 { "ibm865", RTL_TEXTENCODING_IBM_865
},
650 { "cp865", RTL_TEXTENCODING_IBM_865
},
651 { "865", RTL_TEXTENCODING_IBM_865
},
652 { "csibm865", RTL_TEXTENCODING_IBM_865
},
653 { "ibm866", RTL_TEXTENCODING_IBM_866
},
654 { "cp866", RTL_TEXTENCODING_IBM_866
},
655 { "866", RTL_TEXTENCODING_IBM_866
},
656 { "csibm866", RTL_TEXTENCODING_IBM_866
},
657 /* { "ibm868", RTL_TEXTENCODING_IBM_868 }, */
658 /* { "cp868", RTL_TEXTENCODING_IBM_868 }, */
659 /* { "cpar", RTL_TEXTENCODING_IBM_868 }, */
660 /* { "csibm868", RTL_TEXTENCODING_IBM_868 }, */
661 { "ibm869", RTL_TEXTENCODING_IBM_869
},
662 { "cp869", RTL_TEXTENCODING_IBM_869
},
663 { "869", RTL_TEXTENCODING_IBM_869
},
664 { "cpgr", RTL_TEXTENCODING_IBM_869
},
665 { "csibm869", RTL_TEXTENCODING_IBM_869
},
666 { "ibm869", RTL_TEXTENCODING_IBM_869
},
667 { "cp869", RTL_TEXTENCODING_IBM_869
},
668 { "869", RTL_TEXTENCODING_IBM_869
},
669 { "cpgr", RTL_TEXTENCODING_IBM_869
},
670 { "csibm869", RTL_TEXTENCODING_IBM_869
},
671 { "mac", RTL_TEXTENCODING_APPLE_ROMAN
},
672 { "csmacintosh", RTL_TEXTENCODING_APPLE_ROMAN
},
673 { "shiftjis", RTL_TEXTENCODING_SHIFT_JIS
},
674 { "mskanji", RTL_TEXTENCODING_MS_932
},
675 { "csshiftjis", RTL_TEXTENCODING_SHIFT_JIS
},
676 { "jisx0208", RTL_TEXTENCODING_JIS_X_0208
},
677 { "jisc62261983", RTL_TEXTENCODING_JIS_X_0208
},
678 { "csiso87jisx0208", RTL_TEXTENCODING_JIS_X_0208
},
679 { "isoir86", RTL_TEXTENCODING_JIS_X_0208
},
680 { "x0208", RTL_TEXTENCODING_JIS_X_0208
},
681 { "jisx0201", RTL_TEXTENCODING_JIS_X_0201
},
682 { "cshalfwidthkatakana", RTL_TEXTENCODING_JIS_X_0201
},
683 { "x0201", RTL_TEXTENCODING_JIS_X_0201
},
684 { "jisx0212", RTL_TEXTENCODING_JIS_X_0212
},
685 { "csiso159jisx0212", RTL_TEXTENCODING_JIS_X_0212
},
686 { "isoir159", RTL_TEXTENCODING_JIS_X_0208
},
687 { "x0212", RTL_TEXTENCODING_JIS_X_0212
},
688 { "isoir6", RTL_TEXTENCODING_ASCII_US
},
689 { "xsjis", RTL_TEXTENCODING_SHIFT_JIS
},
690 { "sjis", RTL_TEXTENCODING_SHIFT_JIS
},
691 { "ascii", RTL_TEXTENCODING_ASCII_US
},
692 { "us", RTL_TEXTENCODING_ASCII_US
},
693 { "gb180302000", RTL_TEXTENCODING_GB_18030
},
694 /* This is no actual MIME character set name, it is only in here
695 for backwards compatibility (before "GB18030" was officially
696 registered with IANA, this code contained some guesses of what
697 would become official names for GB18030). */
698 { "gb18030", RTL_TEXTENCODING_GB_18030
},
699 { "big5hkscs", RTL_TEXTENCODING_BIG5_HKSCS
},
700 { "tis620", RTL_TEXTENCODING_TIS_620
},
701 { "gbk", RTL_TEXTENCODING_GBK
},
702 { "cp936", RTL_TEXTENCODING_GBK
},
703 { "ms936", RTL_TEXTENCODING_GBK
},
704 { "windows936", RTL_TEXTENCODING_GBK
},
705 { "cp874", RTL_TEXTENCODING_MS_874
},
706 /* This is no official MIME character set name, but it might be in
708 { "ms874", RTL_TEXTENCODING_MS_874
},
709 /* This is no official MIME character set name, but it might be in
711 { "windows874", RTL_TEXTENCODING_MS_874
},
712 /* This is no official MIME character set name, but it might be in
714 { "koi8u", RTL_TEXTENCODING_KOI8_U
},
715 { "cpis", RTL_TEXTENCODING_IBM_861
},
716 { "ksc56011987", RTL_TEXTENCODING_MS_949
},
717 { "isoir149", RTL_TEXTENCODING_MS_949
},
718 { "ksc56011989", RTL_TEXTENCODING_MS_949
},
719 { "ksc5601", RTL_TEXTENCODING_MS_949
},
720 { "korean", RTL_TEXTENCODING_MS_949
},
721 { "csksc56011987", RTL_TEXTENCODING_MS_949
},
722 /* Map KS_C_5601-1987 and aliases to MS-949 instead of EUC-KR, as
723 this character set identifier seems to be prominently used by MS
724 to stand for KS C 5601 plus MS-949 extensions */
725 { "latin9", RTL_TEXTENCODING_ISO_8859_15
},
726 { "adobestandardencoding", RTL_TEXTENCODING_ADOBE_STANDARD
},
727 { "csadobestandardencoding", RTL_TEXTENCODING_ADOBE_STANDARD
},
728 { "adobesymbolencoding", RTL_TEXTENCODING_ADOBE_SYMBOL
},
729 { "cshppsmath", RTL_TEXTENCODING_ADOBE_SYMBOL
},
730 { "ptcp154", RTL_TEXTENCODING_PT154
},
731 { "csptcp154", RTL_TEXTENCODING_PT154
},
732 { "pt154", RTL_TEXTENCODING_PT154
},
733 { "cp154", RTL_TEXTENCODING_PT154
},
734 { "xisciide", RTL_TEXTENCODING_ISCII_DEVANAGARI
},
735 /* This is not an official MIME character set name, but is in use by
736 various windows APIs. */
737 { NULL
, RTL_TEXTENCODING_DONTKNOW
}
740 rtl_TextEncoding eEncoding
= RTL_TEXTENCODING_DONTKNOW
;
741 const ImplStrCharsetDef
* pData
= aVIPMimeCharsetTab
;
742 sal_uInt32 nBufLen
= strlen( pMimeCharset
)+1;
744 /* Alloc Buffer and map to lower case and remove non alphanumeric chars */
745 boost::scoped_array
<char> pBuf(new char[nBufLen
]);
746 Impl_toAsciiLowerAndRemoveNonAlphanumeric( pMimeCharset
, pBuf
.get() );
748 /* Search for equal in the VIP table */
749 while ( pData
->mpCharsetStr
)
751 if ( strcmp( pBuf
.get(), pData
->mpCharsetStr
) == 0 )
753 eEncoding
= pData
->meTextEncoding
;
760 /* Search for matching in the mime table */
761 if ( eEncoding
== RTL_TEXTENCODING_DONTKNOW
)
763 pData
= aMimeCharsetTab
;
764 while ( pData
->mpCharsetStr
)
766 if ( Impl_matchString( pBuf
.get(), pData
->mpCharsetStr
) )
768 eEncoding
= pData
->meTextEncoding
;
779 /* ======================================================================= */
781 sal_uInt8 SAL_CALL
rtl_getBestWindowsCharsetFromTextEncoding( rtl_TextEncoding eTextEncoding
)
783 const ImplTextEncodingData
* pData
= Impl_getTextEncodingData( eTextEncoding
);
785 return pData
->mnBestWindowsCharset
;
790 /* ----------------------------------------------------------------------- */
792 const char* SAL_CALL
rtl_getBestUnixCharsetFromTextEncoding( rtl_TextEncoding eTextEncoding
)
794 const ImplTextEncodingData
* pData
= Impl_getTextEncodingData( eTextEncoding
);
796 return (char const *) pData
->mpBestUnixCharset
;
797 else if( eTextEncoding
== RTL_TEXTENCODING_UNICODE
)
798 return (char const *) "iso10646-1";
803 /* ----------------------------------------------------------------------- */
805 char const * SAL_CALL
rtl_getMimeCharsetFromTextEncoding(rtl_TextEncoding
808 ImplTextEncodingData
const * p
= Impl_getTextEncodingData(nEncoding
);
809 return p
&& (p
->mnInfoFlags
& RTL_TEXTENCODING_INFO_MIME
) != 0 ?
810 p
->mpBestMimeCharset
: NULL
;
813 const char* SAL_CALL
rtl_getBestMimeCharsetFromTextEncoding( rtl_TextEncoding eTextEncoding
)
815 const ImplTextEncodingData
* pData
= Impl_getTextEncodingData( eTextEncoding
);
817 return (char const *) pData
->mpBestMimeCharset
;
822 /* The following two functions are based on <http://www.sharmahd.com/tm/
823 codepages.html>, <http://msdn.microsoft.com/workshop/author/dhtml/reference/
824 charsets/charset4.asp>, and <http://www.iana.org/assignments/character-sets>.
827 rtl_TextEncoding SAL_CALL
828 rtl_getTextEncodingFromWindowsCodePage(sal_uInt32 nCodePage
)
832 case 437: return RTL_TEXTENCODING_IBM_437
;
833 case 708: return RTL_TEXTENCODING_ISO_8859_6
;
834 case 737: return RTL_TEXTENCODING_IBM_737
;
835 case 775: return RTL_TEXTENCODING_IBM_775
;
836 case 850: return RTL_TEXTENCODING_IBM_850
;
837 case 852: return RTL_TEXTENCODING_IBM_852
;
838 case 855: return RTL_TEXTENCODING_IBM_855
;
839 case 857: return RTL_TEXTENCODING_IBM_857
;
840 case 860: return RTL_TEXTENCODING_IBM_860
;
841 case 861: return RTL_TEXTENCODING_IBM_861
;
842 case 862: return RTL_TEXTENCODING_IBM_862
;
843 case 863: return RTL_TEXTENCODING_IBM_863
;
844 case 864: return RTL_TEXTENCODING_IBM_864
;
845 case 865: return RTL_TEXTENCODING_IBM_865
;
846 case 866: return RTL_TEXTENCODING_IBM_866
;
847 case 869: return RTL_TEXTENCODING_IBM_869
;
848 case 874: return RTL_TEXTENCODING_MS_874
;
849 case 932: return RTL_TEXTENCODING_MS_932
;
850 case 936: return RTL_TEXTENCODING_MS_936
;
851 case 949: return RTL_TEXTENCODING_MS_949
;
852 case 950: return RTL_TEXTENCODING_MS_950
;
853 case 1250: return RTL_TEXTENCODING_MS_1250
;
854 case 1251: return RTL_TEXTENCODING_MS_1251
;
855 case 1252: return RTL_TEXTENCODING_MS_1252
;
856 case 1253: return RTL_TEXTENCODING_MS_1253
;
857 case 1254: return RTL_TEXTENCODING_MS_1254
;
858 case 1255: return RTL_TEXTENCODING_MS_1255
;
859 case 1256: return RTL_TEXTENCODING_MS_1256
;
860 case 1257: return RTL_TEXTENCODING_MS_1257
;
861 case 1258: return RTL_TEXTENCODING_MS_1258
;
862 case 1361: return RTL_TEXTENCODING_MS_1361
;
863 case 10000: return RTL_TEXTENCODING_APPLE_ROMAN
;
864 case 10001: return RTL_TEXTENCODING_APPLE_JAPANESE
;
865 case 10002: return RTL_TEXTENCODING_APPLE_CHINTRAD
;
866 case 10003: return RTL_TEXTENCODING_APPLE_KOREAN
;
867 case 10004: return RTL_TEXTENCODING_APPLE_ARABIC
;
868 case 10005: return RTL_TEXTENCODING_APPLE_HEBREW
;
869 case 10006: return RTL_TEXTENCODING_APPLE_GREEK
;
870 case 10007: return RTL_TEXTENCODING_APPLE_CYRILLIC
;
871 case 10008: return RTL_TEXTENCODING_APPLE_CHINSIMP
;
872 case 10010: return RTL_TEXTENCODING_APPLE_ROMANIAN
;
873 case 10017: return RTL_TEXTENCODING_APPLE_UKRAINIAN
;
874 case 10029: return RTL_TEXTENCODING_APPLE_CENTEURO
;
875 case 10079: return RTL_TEXTENCODING_APPLE_ICELAND
;
876 case 10081: return RTL_TEXTENCODING_APPLE_TURKISH
;
877 case 10082: return RTL_TEXTENCODING_APPLE_CROATIAN
;
878 case 20127: return RTL_TEXTENCODING_ASCII_US
;
879 case 20866: return RTL_TEXTENCODING_KOI8_R
;
880 case 21866: return RTL_TEXTENCODING_KOI8_U
;
881 case 28591: return RTL_TEXTENCODING_ISO_8859_1
;
882 case 28592: return RTL_TEXTENCODING_ISO_8859_2
;
883 case 28593: return RTL_TEXTENCODING_ISO_8859_3
;
884 case 28594: return RTL_TEXTENCODING_ISO_8859_4
;
885 case 28595: return RTL_TEXTENCODING_ISO_8859_5
;
886 case 28596: return RTL_TEXTENCODING_ISO_8859_6
;
887 case 28597: return RTL_TEXTENCODING_ISO_8859_7
;
888 case 28598: return RTL_TEXTENCODING_ISO_8859_8
;
889 case 28599: return RTL_TEXTENCODING_ISO_8859_9
;
890 case 28605: return RTL_TEXTENCODING_ISO_8859_15
;
891 case 50220: return RTL_TEXTENCODING_ISO_2022_JP
;
892 case 50225: return RTL_TEXTENCODING_ISO_2022_KR
;
893 case 51932: return RTL_TEXTENCODING_EUC_JP
;
894 case 51936: return RTL_TEXTENCODING_EUC_CN
;
895 case 51949: return RTL_TEXTENCODING_EUC_KR
;
896 case 57002: return RTL_TEXTENCODING_ISCII_DEVANAGARI
;
897 case 65000: return RTL_TEXTENCODING_UTF7
;
898 case 65001: return RTL_TEXTENCODING_UTF8
;
899 default: return RTL_TEXTENCODING_DONTKNOW
;
904 rtl_getWindowsCodePageFromTextEncoding(rtl_TextEncoding nEncoding
)
908 case RTL_TEXTENCODING_IBM_437
: return 437;
909 /* case RTL_TEXTENCODING_ISO_8859_6: return 708; */
910 case RTL_TEXTENCODING_IBM_737
: return 737;
911 case RTL_TEXTENCODING_IBM_775
: return 775;
912 case RTL_TEXTENCODING_IBM_850
: return 850;
913 case RTL_TEXTENCODING_IBM_852
: return 852;
914 case RTL_TEXTENCODING_IBM_855
: return 855;
915 case RTL_TEXTENCODING_IBM_857
: return 857;
916 case RTL_TEXTENCODING_IBM_860
: return 860;
917 case RTL_TEXTENCODING_IBM_861
: return 861;
918 case RTL_TEXTENCODING_IBM_862
: return 862;
919 case RTL_TEXTENCODING_IBM_863
: return 863;
920 case RTL_TEXTENCODING_IBM_864
: return 864;
921 case RTL_TEXTENCODING_IBM_865
: return 865;
922 case RTL_TEXTENCODING_IBM_866
: return 866;
923 case RTL_TEXTENCODING_IBM_869
: return 869;
924 case RTL_TEXTENCODING_MS_874
: return 874;
925 case RTL_TEXTENCODING_MS_932
: return 932;
926 case RTL_TEXTENCODING_MS_936
: return 936;
927 case RTL_TEXTENCODING_MS_949
: return 949;
928 case RTL_TEXTENCODING_MS_950
: return 950;
929 case RTL_TEXTENCODING_MS_1250
: return 1250;
930 case RTL_TEXTENCODING_MS_1251
: return 1251;
931 case RTL_TEXTENCODING_MS_1252
: return 1252;
932 case RTL_TEXTENCODING_MS_1253
: return 1253;
933 case RTL_TEXTENCODING_MS_1254
: return 1254;
934 case RTL_TEXTENCODING_MS_1255
: return 1255;
935 case RTL_TEXTENCODING_MS_1256
: return 1256;
936 case RTL_TEXTENCODING_MS_1257
: return 1257;
937 case RTL_TEXTENCODING_MS_1258
: return 1258;
938 case RTL_TEXTENCODING_MS_1361
: return 1361;
939 case RTL_TEXTENCODING_APPLE_ROMAN
: return 10000;
940 case RTL_TEXTENCODING_APPLE_JAPANESE
: return 10001;
941 case RTL_TEXTENCODING_APPLE_CHINTRAD
: return 10002;
942 case RTL_TEXTENCODING_APPLE_KOREAN
: return 10003;
943 case RTL_TEXTENCODING_APPLE_ARABIC
: return 10004;
944 case RTL_TEXTENCODING_APPLE_HEBREW
: return 10005;
945 case RTL_TEXTENCODING_APPLE_GREEK
: return 10006;
946 case RTL_TEXTENCODING_APPLE_CYRILLIC
: return 10007;
947 case RTL_TEXTENCODING_APPLE_CHINSIMP
: return 10008;
948 case RTL_TEXTENCODING_APPLE_ROMANIAN
: return 10010;
949 case RTL_TEXTENCODING_APPLE_UKRAINIAN
: return 10017;
950 case RTL_TEXTENCODING_APPLE_CENTEURO
: return 10029;
951 case RTL_TEXTENCODING_APPLE_ICELAND
: return 10079;
952 case RTL_TEXTENCODING_APPLE_TURKISH
: return 10081;
953 case RTL_TEXTENCODING_APPLE_CROATIAN
: return 10082;
954 case RTL_TEXTENCODING_ASCII_US
: return 20127;
955 case RTL_TEXTENCODING_KOI8_R
: return 20866;
956 case RTL_TEXTENCODING_KOI8_U
: return 21866;
957 case RTL_TEXTENCODING_ISO_8859_1
: return 28591;
958 case RTL_TEXTENCODING_ISO_8859_2
: return 28592;
959 case RTL_TEXTENCODING_ISO_8859_3
: return 28593;
960 case RTL_TEXTENCODING_ISO_8859_4
: return 28594;
961 case RTL_TEXTENCODING_ISO_8859_5
: return 28595;
962 case RTL_TEXTENCODING_ISO_8859_6
: return 28596;
963 case RTL_TEXTENCODING_ISO_8859_7
: return 28597;
964 case RTL_TEXTENCODING_ISO_8859_8
: return 28598;
965 case RTL_TEXTENCODING_ISO_8859_9
: return 28599;
966 case RTL_TEXTENCODING_ISO_8859_15
: return 28605;
967 case RTL_TEXTENCODING_ISO_2022_JP
: return 50220;
968 case RTL_TEXTENCODING_ISO_2022_KR
: return 50225;
969 case RTL_TEXTENCODING_EUC_JP
: return 51932;
970 case RTL_TEXTENCODING_EUC_CN
: return 51936;
971 case RTL_TEXTENCODING_EUC_KR
: return 51949;
972 case RTL_TEXTENCODING_ISCII_DEVANAGARI
: return 57002;
973 case RTL_TEXTENCODING_UTF7
: return 65000;
974 case RTL_TEXTENCODING_UTF8
: return 65001;
979 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */