diff options
Diffstat (limited to 'sal/textenc/tencinfo.c')
-rw-r--r-- | sal/textenc/tencinfo.c | 165 |
1 files changed, 4 insertions, 161 deletions
diff --git a/sal/textenc/tencinfo.c b/sal/textenc/tencinfo.c index 30a2fef0da72..2731880c66d2 100644 --- a/sal/textenc/tencinfo.c +++ b/sal/textenc/tencinfo.c @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -212,166 +213,6 @@ rtl_TextEncoding SAL_CALL rtl_getTextEncodingFromWindowsCharset( sal_uInt8 nWinC /* ----------------------------------------------------------------------- */ -#if 0 - -rtl_TextEncoding SAL_CALL rtl_getTextEncodingFromMacTextEncoding( sal_uInt32 nMacTextEncoding ) -{ - rtl_TextEncoding eTextEncoding; - - switch ( nMacTextEncoding ) - { - case 0: eTextEncoding = RTL_TEXTENCODING_APPLE_ROMAN; break; - case 1: eTextEncoding = RTL_TEXTENCODING_APPLE_JAPANESE; break; - case 2: eTextEncoding = RTL_TEXTENCODING_APPLE_CHINTRAD; break; - case 3: eTextEncoding = RTL_TEXTENCODING_APPLE_KOREAN; break; - case 4: eTextEncoding = RTL_TEXTENCODING_APPLE_ARABIC; break; - case 5: eTextEncoding = RTL_TEXTENCODING_APPLE_HEBREW; break; - case 6: eTextEncoding = RTL_TEXTENCODING_APPLE_GREEK; break; - case 7: eTextEncoding = RTL_TEXTENCODING_APPLE_CYRILLIC; break; - /* RIGHT-TO-LEFT SYMBOLS = 8 ??? */ - case 9: eTextEncoding = RTL_TEXTENCODING_APPLE_DEVANAGARI; break; - case 10: eTextEncoding = RTL_TEXTENCODING_APPLE_GURMUKHI; break; - case 11: eTextEncoding = RTL_TEXTENCODING_APPLE_GUJARATI; break; - /* MacOriya = 12 */ - /* MacBengali = 13 */ - /* MacTamil = 14 */ - /* MacTelugu = 15 */ - /* MacKannada = 16 */ - /* MacMalayalam = 17 */ - /* MacSinhalese = 18 */ - /* MacBurmese = 19 */ - /* MacKhmer = 20 */ - case 21: eTextEncoding = RTL_TEXTENCODING_APPLE_THAI; break; - /* MacLaotian = 22 */ - /* MacGeorgian = 23 */ - /* MacArmenian = 24 */ - case 25: eTextEncoding = RTL_TEXTENCODING_APPLE_CHINSIMP; break; - /* MacTibetan = 26 */ - /* MacMongolian = 27 */ - /* MacEthiopic = 28 */ - case 29: eTextEncoding = RTL_TEXTENCODING_APPLE_CENTEURO; break; /* MacCentralEurRoman */ - /* MacVietnamese = 30 */ - /* MacExtArabic = 31 */ - case 32: eTextEncoding = RTL_TEXTENCODING_SYMBOL; break; - case 33: eTextEncoding = RTL_TEXTENCODING_SYMBOL; break; /* MacSymbol */ - case 34: eTextEncoding = RTL_TEXTENCODING_SYMBOL; break; /* MacDingbats */ - case 35: eTextEncoding = RTL_TEXTENCODING_APPLE_TURKISH; break; /* MacTurkish */ - case 36: eTextEncoding = RTL_TEXTENCODING_APPLE_CROATIAN; break; /* MacCroatian */ - case 37: eTextEncoding = RTL_TEXTENCODING_APPLE_ICELAND; break; /* MacIcelandic */ - case 38: eTextEncoding = RTL_TEXTENCODING_APPLE_ROMANIAN; break; /* MacRomanian */ - /* MacCeltic = 39 */ - /* MacGaelic = 40 */ - /* Beginning in Mac OS 8.5, the set of Mac OS script codes has been */ - /* extended for some Mac OS components to include Unicode. Some of */ - /* these components have only 7 bits available for script code, so */ - /* kTextEncodingUnicodeDefault cannot be used to indicate Unicode. */ - /* Instead, the following meta-value is used to indicate Unicode */ - /* handled as a special Mac OS script code; TEC handles this value */ - /* like kTextEncodingUnicodeDefault. */ - /* The following use script code 4, smArabic */ - case 0x08C: eTextEncoding = RTL_TEXTENCODING_APPLE_FARSI; break; /* MacFarsi */ - /* The following use script code 7, smCyrillic */ - case 0x098: eTextEncoding = RTL_TEXTENCODING_APPLE_UKRAINIAN; break; /* MacUkrainian */ - /* The following use script code 28, smEthiopic */ - /* MacInuit = 0xEC */ - /* The following use script code 32, smUninterp */ - case 0x0FC: eTextEncoding = RTL_TEXTENCODING_SYMBOL; break; /* MacVT100 - VT100/102 font */ - /* Special Mac OS encodings */ - /* MacHFS = 0xFF */ /* metavalue. */ - /* Unicode & ISO UCS encodings begin at 0x100 */ - case 0x100: eTextEncoding = RTL_TEXTENCODING_UNICODE; break; /* UnicodeDefault */ - case 0x101: eTextEncoding = RTL_TEXTENCODING_UNICODE; break; /* UnicodeV1_1 / ISO10646_1993 */ - case 0x103: eTextEncoding = RTL_TEXTENCODING_UNICODE; break; /* UnicodeV2_1 - new location for Korean Hangul / UnicodeV2_1 */ - /* ISO 8-bit and 7-bit encodings begin at 0x200 */ - case 0x201: eTextEncoding = RTL_TEXTENCODING_ISO_8859_1; break; /* ISOLatin1 - ISO 8859-1 */ - case 0x202: eTextEncoding = RTL_TEXTENCODING_ISO_8859_2; break; /* ISOLatin2 - ISO 8859-2 */ - case 0x203: eTextEncoding = RTL_TEXTENCODING_ISO_8859_3; break; /* ISOLatin3 - ISO 8859-3 */ - case 0x204: eTextEncoding = RTL_TEXTENCODING_ISO_8859_4; break; /* ISOLatin4 - ISO 8859-4 */ - case 0x205: eTextEncoding = RTL_TEXTENCODING_ISO_8859_5; break; /* ISOLatinCyrillic - ISO 8859-5 */ - case 0x206: eTextEncoding = RTL_TEXTENCODING_ISO_8859_6; break; /* ISOLatinArabic - ISO 8859-6, = ASMO 708, =DOS CP 708 */ - case 0x207: eTextEncoding = RTL_TEXTENCODING_ISO_8859_7; break; /* ISOLatinGreek - ISO 8859-7 */ - case 0x208: eTextEncoding = RTL_TEXTENCODING_ISO_8859_8; break; /* ISOLatinHebrew - ISO 8859-8 */ - case 0x209: eTextEncoding = RTL_TEXTENCODING_ISO_8859_9; break; /* ISOLatin5 - ISO 8859-9 */ - /* MS-DOS & Windows encodings begin at 0x400 */ - case 0x400: eTextEncoding = RTL_TEXTENCODING_IBM_437; break; /* DOSLatinUS - code page 437 */ - case 0x405: eTextEncoding = RTL_TEXTENCODING_IBM_737; break; /* DOSGreek - code page 737 (formerly 437G) */ - case 0x406: eTextEncoding = RTL_TEXTENCODING_IBM_775; break; /* DOSBalticRim - code page 775 */ - case 0x410: eTextEncoding = RTL_TEXTENCODING_IBM_850; break; /* DOSLatin1 - code page 850, "Multilingual" */ -/* !!! case 0x411: eTextEncoding = RTL_TEXTENCODING_IBM_851; break; */ /* DOSGreek1 - code page 851 */ - case 0x412: eTextEncoding = RTL_TEXTENCODING_IBM_852; break; /* DOSLatin2 - code page 852, Slavic */ - case 0x413: eTextEncoding = RTL_TEXTENCODING_IBM_855; break; /* DOSCyrillic - code page 855, IBM Cyrillic */ - case 0x414: eTextEncoding = RTL_TEXTENCODING_IBM_857; break; /* DOSTurkish - code page 857, IBM Turkish */ - case 0x415: eTextEncoding = RTL_TEXTENCODING_IBM_860; break; /* DOSPortuguese - code page 860 */ - case 0x416: eTextEncoding = RTL_TEXTENCODING_IBM_861; break; /* DOSIcelandic - code page 861 */ - case 0x417: eTextEncoding = RTL_TEXTENCODING_IBM_862; break; /* DOSHebrew - code page 862 */ - case 0x418: eTextEncoding = RTL_TEXTENCODING_IBM_863; break; /* DOSCanadianFrench - code page 863 */ - case 0x419: eTextEncoding = RTL_TEXTENCODING_IBM_864; break; /* DOSArabic - code page 864 */ - case 0x41A: eTextEncoding = RTL_TEXTENCODING_IBM_865; break; /* DOSNordic - code page 865 */ - case 0x41B: eTextEncoding = RTL_TEXTENCODING_IBM_866; break; /* DOSRussian - code page 866 */ - case 0x41C: eTextEncoding = RTL_TEXTENCODING_IBM_869; break; /* DOSGreek2 - code page 869, IBM Modern Greek */ - case 0x41D: eTextEncoding = RTL_TEXTENCODING_MS_874; break; /* DOSThai - code page 874, also for Windows */ - case 0x420: eTextEncoding = RTL_TEXTENCODING_MS_932; break; /* DOSJapanese - code page 932, also for Windows */ - case 0x421: eTextEncoding = RTL_TEXTENCODING_MS_936; break; /* DOSChineseSimplif - code page 936, also for Windows */ - case 0x422: eTextEncoding = RTL_TEXTENCODING_MS_949; break; /* DOSKorean - code page 949, also for Windows;Unified Hangul */ - case 0x423: eTextEncoding = RTL_TEXTENCODING_MS_950; break; /* DOSChineseTrad - code page 950, also for Windows */ - case 0x500: eTextEncoding = RTL_TEXTENCODING_MS_1252; break; /* WindowsLatin1 / WindowsANSI - code page 1252 */ - case 0x501: eTextEncoding = RTL_TEXTENCODING_MS_1250; break; /* WindowsLatin2 - code page 1250, Central Europe */ - case 0x502: eTextEncoding = RTL_TEXTENCODING_MS_1251; break; /* WindowsCyrillic - code page 1251, Slavic Cyrillic */ - case 0x503: eTextEncoding = RTL_TEXTENCODING_MS_1253; break; /* WindowsGreek - code page 1253 */ - case 0x504: eTextEncoding = RTL_TEXTENCODING_MS_1254; break; /* WindowsLatin5 - code page 1254, Turkish */ - case 0x505: eTextEncoding = RTL_TEXTENCODING_MS_1255; break; /* WindowsHebrew - code page 1255 */ - case 0x506: eTextEncoding = RTL_TEXTENCODING_MS_1256; break; /* WindowsArabic - code page 1256 */ - case 0x507: eTextEncoding = RTL_TEXTENCODING_MS_1257; break; /* WindowsBalticRim - code page 1257 */ - case 0x508: eTextEncoding = RTL_TEXTENCODING_MS_1258; break; /* WindowsVietnamese - code page 1258 */ - case 0x510: eTextEncoding = RTL_TEXTENCODING_MS_1361; break; /* WindowsKoreanJohab - code page 1361, for Windows NT */ - /* Various national standards begin at 0x600 */ - case 0x600: eTextEncoding = RTL_TEXTENCODING_ASCII_US; break; /* US_ASCII */ - case 0x620: eTextEncoding = RTL_TEXTENCODING_JIS_X_0201; break; /* JIS_X0201_76 */ - case 0x621: eTextEncoding = RTL_TEXTENCODING_JIS_X_0208; break; /* JIS_X0208_83 */ - case 0x622: eTextEncoding = RTL_TEXTENCODING_JIS_X_0208; break; /* JIS_X0208_90 */ - case 0x623: eTextEncoding = RTL_TEXTENCODING_JIS_X_0212; break; /* JIS_X0212_90 */ - /* !!! JIS_C6226_78 = 0x624 */ - /* !!! GB_2312_80 = 0x630 */ - /* !!! GBK_95 = 0x631 */ /* annex to GB 13000-93; for Windows 95 */ -// case 0x640: eTextEncoding = RTL_TEXTENCODING_KSC_5601_1987; break; /* KSC_5601_87 */ /* same as KSC 5601-92 without Johab annex */ -// case 0x641: eTextEncoding = RTL_TEXTENCODING_KSC_5601_1992; break; /* KSC 5601-92 Johab annex */ - /* !!! CNS_11643_92_P1 = 0x651 */ /* CNS 11643-1992 plane 1 */ - /* !!! CNS_11643_92_P2 = 0x652 */ /* CNS 11643-1992 plane 2 */ - /* !!! CNS_11643_92_P3 = 0x653 */ /* CNS 11643-1992 plane 3 (11643-1986 plane 14) */ - /* ISO 2022 collections begin at 0x800 */ - case 0x820: eTextEncoding = RTL_TEXTENCODING_ISO_2022_JP; break; /* ISO_2022_JP */ - case 0x821: eTextEncoding = RTL_TEXTENCODING_ISO_2022_JP; break; /* ISO_2022_JP_2 */ - case 0x830: eTextEncoding = RTL_TEXTENCODING_ISO_2022_CN; break; /* ISO_2022_CN */ - case 0x831: eTextEncoding = RTL_TEXTENCODING_ISO_2022_CN; break; /* ISO_2022_CN_EXT */ - /* !!! ISO_2022_KR = 0x840 */ - /* EUC collections begin at 0x900 */ - case 0x920: eTextEncoding = RTL_TEXTENCODING_EUC_JP; break; /* EUC_JP - ISO 646,1-byte Katakana,JIS 208,JIS 212 */ - case 0x930: eTextEncoding = RTL_TEXTENCODING_EUC_CN; break; /* EUC_CN - ISO 646, GB 2312-80 */ - case 0x931: eTextEncoding = RTL_TEXTENCODING_EUC_TW; break; /* EUC_TW - ISO 646, CNS 11643-1992 Planes 1-16 */ - case 0x940: eTextEncoding = RTL_TEXTENCODING_EUC_KR; break; /* EUC_KR - ISO 646, KS C 5601-1987 */ - /* Miscellaneous standards begin at 0xA00 */ - case 0xA01: eTextEncoding = RTL_TEXTENCODING_SHIFT_JIS; break; /* ShiftJIS - plain Shift-JIS */ - case 0xA02: eTextEncoding = RTL_TEXTENCODING_KOI8_R; break; /* KOI8_R - Russian Internet standard */ - case 0xA03: eTextEncoding = RTL_TEXTENCODING_BIG5; break; /* Big5 - Big-5 */ - /* !!! MacRomanLatin1 = 0xA04 */ /* Mac OS Roman permuted to align with 8859-1 */ - /* !!! HZ_GB_2312 = 0xA05 */ /* HZ (RFC 1842, for Chinese mail & news) */ - /* Other platform encodings */ - /* !!! NextStepLatin = 0xB01 */ /* NextStep encoding */ - /* EBCDIC & IBM host encodings begin at 0xC00 */ - /* !!! EBCDIC_US = 0xC01 */ /* basic EBCDIC-US */ - /* !!! EBCDIC_CP037 = 0xC02 */ /* code page 037, extended EBCDIC-US Latin1 */ - /* Special value */ - /* MultiRun = 0xFFF */ /* Multiple encoded text, external run info */ - default: eTextEncoding = RTL_TEXTENCODING_DONTKNOW; break; - }; - - return eTextEncoding; -} - -#endif - -/* ----------------------------------------------------------------------- */ - rtl_TextEncoding SAL_CALL rtl_getTextEncodingFromUnixCharset( const sal_Char* pUnixCharset ) { /* See <ftp://ftp.x.org/pub/DOCS/registry>, section 14 ("Font Charset @@ -911,7 +752,7 @@ rtl_TextEncoding SAL_CALL rtl_getTextEncodingFromMimeCharset( const sal_Char* pM { "pt154", RTL_TEXTENCODING_PT154 }, { "cp154", RTL_TEXTENCODING_PT154 }, { "xisciide", RTL_TEXTENCODING_ISCII_DEVANAGARI }, - /* This is no official MIME character set name, but is in use by + /* This is not an official MIME character set name, but is in use by various windows APIs. */ { NULL, RTL_TEXTENCODING_DONTKNOW } }; @@ -1157,3 +998,5 @@ rtl_getWindowsCodePageFromTextEncoding(rtl_TextEncoding nEncoding) default: return 0; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |