Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Functions | Variables
nsCSIDtoCharsetName.cpp File Reference
#include "nsI18nCompatibility.h"

Go to the source code of this file.

Classes

struct  _csname2id_t

Defines

#define SINGLEBYTE   0x0000 /* 0000 0000 0000 0000 = 0 */
#define MULTIBYTE   0x0100 /* 0000 0001 0000 0000 = 256 */
#define STATEFUL   0x0200 /* 0000 0010 0000 0000 = 512 */
#define WIDECHAR   0x0300 /* 0000 0011 0000 0000 = 768 */
#define CODESET_MASK   0x0F00 /* 0000 1111 0000 0000 = 3840 */
#define IS_16BIT_ENCODING(x)   (((x)&CODESET_MASK) == MULTIBYTE)
#define CS_SPACE   0x0400 /* 0000 0100 0000 0000 = 1024 */
#define CS_AUTO   0x0800 /* 0000 1000 0000 0000 = 2048 */
#define CS_DEFAULT   (SINGLEBYTE | 0) /* 0 */
#define CS_ASCII   (SINGLEBYTE | 1) /* 1 */
#define CS_LATIN1   (SINGLEBYTE | 2) /* 2 */
#define CS_JIS   (STATEFUL | 3) /* 515 */
#define CS_SJIS   (MULTIBYTE | 4) /* 260 */
#define CS_EUCJP   (MULTIBYTE | 5) /* 261 */
#define CS_JIS_AUTO   (CS_AUTO|STATEFUL | 3) /* 2563 */
#define CS_SJIS_AUTO   (CS_AUTO|MULTIBYTE | 4) /* 2308 */
#define CS_EUCJP_AUTO   (CS_AUTO|MULTIBYTE | 5) /* 2309 */
#define CS_MAC_ROMAN   (SINGLEBYTE | 6) /* 6 */
#define CS_BIG5   (MULTIBYTE | 7) /* 263 */
#define CS_GB_8BIT   (MULTIBYTE | 8) /* 264 */
#define CS_CNS_8BIT   (MULTIBYTE | 9) /* 265 */
#define CS_LATIN2   (SINGLEBYTE | 10) /* 10 */
#define CS_MAC_CE   (SINGLEBYTE | 11) /* 11 */
#define CS_KSC_8BIT   (MULTIBYTE|CS_SPACE | 12) /* 1292 */
#define CS_KSC_8BIT_AUTO   (CS_AUTO | MULTIBYTE|CS_SPACE | 12)
#define CS_2022_KR   (STATEFUL | 13) /* 525 */
#define CS_8859_3   (SINGLEBYTE | 14) /* 14 */
#define CS_8859_4   (SINGLEBYTE | 15) /* 15 */
#define CS_8859_5   (SINGLEBYTE | 16) /* 16 ISO Cyrillic */
#define CS_8859_6   (SINGLEBYTE | 17) /* 17 ISO Arabic */
#define CS_8859_7   (SINGLEBYTE | 18) /* 18 ISO Greek */
#define CS_8859_8   (SINGLEBYTE | 19) /* 19 ISO Hebrew */
#define CS_8859_9   (SINGLEBYTE | 20) /* 20 */
#define CS_SYMBOL   (SINGLEBYTE | 21) /* 21 */
#define CS_DINGBATS   (SINGLEBYTE | 22) /* 22 */
#define CS_DECTECH   (SINGLEBYTE | 23) /* 23 */
#define CS_CNS11643_1   (MULTIBYTE | 24) /* 280 */
#define CS_CNS11643_2   (MULTIBYTE | 25) /* 281 */
#define CS_JISX0208   (MULTIBYTE | 26) /* 282 */
#define CS_JISX0201   (SINGLEBYTE | 27) /* 27 */
#define CS_KSC5601   (MULTIBYTE | 28) /* 284 */
#define CS_TIS620   (SINGLEBYTE | 29) /* 29 */
#define CS_JISX0212   (MULTIBYTE | 30) /* 286 */
#define CS_GB2312   (MULTIBYTE | 31) /* 287 */
#define CS_UCS2   (WIDECHAR | 32) /* 810 */
#define CS_UCS4   (WIDECHAR | 33) /* 811 */
#define CS_UTF8   (MULTIBYTE | 34) /* 290 */
#define CS_UTF7   (STATEFUL | 35) /* 35 */
#define CS_NPC   (MULTIBYTE | 36) /* 292 */
#define CS_X_BIG5   (MULTIBYTE | 37) /* 293 */
#define CS_USRDEF2   (SINGLEBYTE | 38) /* 38 */
#define CS_KOI8_R   (SINGLEBYTE | 39) /* 39 */
#define CS_MAC_CYRILLIC   (SINGLEBYTE | 40) /* 40 */
#define CS_CP_1251   (SINGLEBYTE | 41) /* 41 CS_CP_1251 is window Cyrillic */
#define CS_MAC_GREEK   (SINGLEBYTE | 42) /* 42 */
#define CS_CP_1253   (SINGLEBYTE | 43) /* 43 CS_CP_1253 is window Greek */
#define CS_CP_1250   (SINGLEBYTE | 44) /* 44 CS_CP_1250 is window Centrl Europe */
#define CS_CP_1254   (SINGLEBYTE | 45) /* 45 CS_CP_1254 is window Turkish */
#define CS_MAC_TURKISH   (SINGLEBYTE | 46) /* 46 */
#define CS_GB2312_11   (MULTIBYTE | 47) /* 303 */
#define CS_JISX0208_11   (MULTIBYTE | 48) /* 304 */
#define CS_KSC5601_11   (MULTIBYTE | 49) /* 305 */
#define CS_CNS11643_1110   (MULTIBYTE | 50) /* 306 */
#define CS_UCS2_SWAP   (WIDECHAR | 51) /* 819 */
#define CS_IMAP4_UTF7   (STATEFUL | 52) /* 564 */
#define CS_T61   (MULTIBYTE | 53) /* This line should not merged into 5.0 */
#define CS_HZ   (STATEFUL | 54) /* 566 */
#define CS_CP_850   (SINGLEBYTE | 55) /* 55 PC Latin 1 */
#define CS_CP_852   (SINGLEBYTE | 56) /* 56 PC Latin 2 */
#define CS_CP_855   (SINGLEBYTE | 57) /* 57 PC Cyrillic */
#define CS_CP_857   (SINGLEBYTE | 58) /* 58 PC Turkish */
#define CS_CP_862   (SINGLEBYTE | 59) /* 59 PC Hebrew */
#define CS_CP_864   (SINGLEBYTE | 60) /* 60 PC Arabic */
#define CS_CP_866   (SINGLEBYTE | 61) /* 61 PC Russian */
#define CS_CP_1255   (SINGLEBYTE | 62) /* 62 Windows Hebrew */
#define CS_CP_1256   (SINGLEBYTE | 63) /* 63 Windows Arabic */
#define CS_CP_1257   (SINGLEBYTE | 64) /* 64 Windows Baltic */
#define CS_CP_1258   (SINGLEBYTE | 65) /* 65 Windows Vietnamese */
#define CS_8859_15   (SINGLEBYTE | 66) /* 66 EURO Support latin */
#define INTL_CHAR_SET_MAX   67 /* must be highest + 1 */
#define CS_USER_DEFINED_ENCODING   (SINGLEBYTE | 254) /* 254 */
#define CS_UNKNOWN   (SINGLEBYTE | 255) /* 255 */
#define IS_UTF8_CSID(x)   (((x)&0xFF)== (CS_UTF8&0xFF))
#define IS_UNICODE_CSID(x)
#define CS_FE_ASCII   CS_LATIN1
#define MAX_CSNAME   64

Typedefs

typedef struct _csname2id_t csname2id_t

Functions

static const char * INTL_CsidToCharsetNamePt (PRUint16 csid)
const char * I18N_CSIDtoCharsetName (PRUint16 csid)

Variables

static csname2id_t csname2id_tbl []

Class Documentation

struct _csname2id_t

Definition at line 186 of file nsCSIDtoCharsetName.cpp.

Class Members
PRUint16 cs_id
char cs_name
char fill
char java_name

Define Documentation

#define CODESET_MASK   0x0F00 /* 0000 1111 0000 0000 = 3840 */

Definition at line 61 of file nsCSIDtoCharsetName.cpp.

#define CS_2022_KR   (STATEFUL | 13) /* 525 */

Definition at line 103 of file nsCSIDtoCharsetName.cpp.

#define CS_8859_15   (SINGLEBYTE | 66) /* 66 EURO Support latin */

Definition at line 160 of file nsCSIDtoCharsetName.cpp.

#define CS_8859_3   (SINGLEBYTE | 14) /* 14 */

Definition at line 104 of file nsCSIDtoCharsetName.cpp.

#define CS_8859_4   (SINGLEBYTE | 15) /* 15 */

Definition at line 105 of file nsCSIDtoCharsetName.cpp.

#define CS_8859_5   (SINGLEBYTE | 16) /* 16 ISO Cyrillic */

Definition at line 106 of file nsCSIDtoCharsetName.cpp.

#define CS_8859_6   (SINGLEBYTE | 17) /* 17 ISO Arabic */

Definition at line 107 of file nsCSIDtoCharsetName.cpp.

#define CS_8859_7   (SINGLEBYTE | 18) /* 18 ISO Greek */

Definition at line 108 of file nsCSIDtoCharsetName.cpp.

#define CS_8859_8   (SINGLEBYTE | 19) /* 19 ISO Hebrew */

Definition at line 109 of file nsCSIDtoCharsetName.cpp.

#define CS_8859_9   (SINGLEBYTE | 20) /* 20 */

Definition at line 110 of file nsCSIDtoCharsetName.cpp.

#define CS_ASCII   (SINGLEBYTE | 1) /* 1 */

Definition at line 82 of file nsCSIDtoCharsetName.cpp.

#define CS_AUTO   0x0800 /* 0000 1000 0000 0000 = 2048 */

Definition at line 73 of file nsCSIDtoCharsetName.cpp.

#define CS_BIG5   (MULTIBYTE | 7) /* 263 */

Definition at line 93 of file nsCSIDtoCharsetName.cpp.

#define CS_CNS11643_1   (MULTIBYTE | 24) /* 280 */

Definition at line 114 of file nsCSIDtoCharsetName.cpp.

#define CS_CNS11643_1110   (MULTIBYTE | 50) /* 306 */

Definition at line 143 of file nsCSIDtoCharsetName.cpp.

#define CS_CNS11643_2   (MULTIBYTE | 25) /* 281 */

Definition at line 115 of file nsCSIDtoCharsetName.cpp.

#define CS_CNS_8BIT   (MULTIBYTE | 9) /* 265 */

Definition at line 95 of file nsCSIDtoCharsetName.cpp.

#define CS_CP_1250   (SINGLEBYTE | 44) /* 44 CS_CP_1250 is window Centrl Europe */

Definition at line 136 of file nsCSIDtoCharsetName.cpp.

#define CS_CP_1251   (SINGLEBYTE | 41) /* 41 CS_CP_1251 is window Cyrillic */

Definition at line 132 of file nsCSIDtoCharsetName.cpp.

#define CS_CP_1253   (SINGLEBYTE | 43) /* 43 CS_CP_1253 is window Greek */

Definition at line 135 of file nsCSIDtoCharsetName.cpp.

#define CS_CP_1254   (SINGLEBYTE | 45) /* 45 CS_CP_1254 is window Turkish */

Definition at line 138 of file nsCSIDtoCharsetName.cpp.

#define CS_CP_1255   (SINGLEBYTE | 62) /* 62 Windows Hebrew */

Definition at line 156 of file nsCSIDtoCharsetName.cpp.

#define CS_CP_1256   (SINGLEBYTE | 63) /* 63 Windows Arabic */

Definition at line 157 of file nsCSIDtoCharsetName.cpp.

#define CS_CP_1257   (SINGLEBYTE | 64) /* 64 Windows Baltic */

Definition at line 158 of file nsCSIDtoCharsetName.cpp.

#define CS_CP_1258   (SINGLEBYTE | 65) /* 65 Windows Vietnamese */

Definition at line 159 of file nsCSIDtoCharsetName.cpp.

#define CS_CP_850   (SINGLEBYTE | 55) /* 55 PC Latin 1 */

Definition at line 149 of file nsCSIDtoCharsetName.cpp.

#define CS_CP_852   (SINGLEBYTE | 56) /* 56 PC Latin 2 */

Definition at line 150 of file nsCSIDtoCharsetName.cpp.

#define CS_CP_855   (SINGLEBYTE | 57) /* 57 PC Cyrillic */

Definition at line 151 of file nsCSIDtoCharsetName.cpp.

#define CS_CP_857   (SINGLEBYTE | 58) /* 58 PC Turkish */

Definition at line 152 of file nsCSIDtoCharsetName.cpp.

#define CS_CP_862   (SINGLEBYTE | 59) /* 59 PC Hebrew */

Definition at line 153 of file nsCSIDtoCharsetName.cpp.

#define CS_CP_864   (SINGLEBYTE | 60) /* 60 PC Arabic */

Definition at line 154 of file nsCSIDtoCharsetName.cpp.

#define CS_CP_866   (SINGLEBYTE | 61) /* 61 PC Russian */

Definition at line 155 of file nsCSIDtoCharsetName.cpp.

#define CS_DECTECH   (SINGLEBYTE | 23) /* 23 */

Definition at line 113 of file nsCSIDtoCharsetName.cpp.

#define CS_DEFAULT   (SINGLEBYTE | 0) /* 0 */

Definition at line 81 of file nsCSIDtoCharsetName.cpp.

#define CS_DINGBATS   (SINGLEBYTE | 22) /* 22 */

Definition at line 112 of file nsCSIDtoCharsetName.cpp.

#define CS_EUCJP   (MULTIBYTE | 5) /* 261 */

Definition at line 86 of file nsCSIDtoCharsetName.cpp.

#define CS_EUCJP_AUTO   (CS_AUTO|MULTIBYTE | 5) /* 2309 */

Definition at line 90 of file nsCSIDtoCharsetName.cpp.

Definition at line 177 of file nsCSIDtoCharsetName.cpp.

#define CS_GB2312   (MULTIBYTE | 31) /* 287 */

Definition at line 121 of file nsCSIDtoCharsetName.cpp.

#define CS_GB2312_11   (MULTIBYTE | 47) /* 303 */

Definition at line 140 of file nsCSIDtoCharsetName.cpp.

#define CS_GB_8BIT   (MULTIBYTE | 8) /* 264 */

Definition at line 94 of file nsCSIDtoCharsetName.cpp.

#define CS_HZ   (STATEFUL | 54) /* 566 */

Definition at line 147 of file nsCSIDtoCharsetName.cpp.

#define CS_IMAP4_UTF7   (STATEFUL | 52) /* 564 */

Definition at line 145 of file nsCSIDtoCharsetName.cpp.

#define CS_JIS   (STATEFUL | 3) /* 515 */

Definition at line 84 of file nsCSIDtoCharsetName.cpp.

#define CS_JIS_AUTO   (CS_AUTO|STATEFUL | 3) /* 2563 */

Definition at line 88 of file nsCSIDtoCharsetName.cpp.

#define CS_JISX0201   (SINGLEBYTE | 27) /* 27 */

Definition at line 117 of file nsCSIDtoCharsetName.cpp.

#define CS_JISX0208   (MULTIBYTE | 26) /* 282 */

Definition at line 116 of file nsCSIDtoCharsetName.cpp.

#define CS_JISX0208_11   (MULTIBYTE | 48) /* 304 */

Definition at line 141 of file nsCSIDtoCharsetName.cpp.

#define CS_JISX0212   (MULTIBYTE | 30) /* 286 */

Definition at line 120 of file nsCSIDtoCharsetName.cpp.

#define CS_KOI8_R   (SINGLEBYTE | 39) /* 39 */

Definition at line 130 of file nsCSIDtoCharsetName.cpp.

#define CS_KSC5601   (MULTIBYTE | 28) /* 284 */

Definition at line 118 of file nsCSIDtoCharsetName.cpp.

#define CS_KSC5601_11   (MULTIBYTE | 49) /* 305 */

Definition at line 142 of file nsCSIDtoCharsetName.cpp.

#define CS_KSC_8BIT   (MULTIBYTE|CS_SPACE | 12) /* 1292 */

Definition at line 98 of file nsCSIDtoCharsetName.cpp.

Definition at line 101 of file nsCSIDtoCharsetName.cpp.

#define CS_LATIN1   (SINGLEBYTE | 2) /* 2 */

Definition at line 83 of file nsCSIDtoCharsetName.cpp.

#define CS_LATIN2   (SINGLEBYTE | 10) /* 10 */

Definition at line 96 of file nsCSIDtoCharsetName.cpp.

#define CS_MAC_CE   (SINGLEBYTE | 11) /* 11 */

Definition at line 97 of file nsCSIDtoCharsetName.cpp.

#define CS_MAC_CYRILLIC   (SINGLEBYTE | 40) /* 40 */

Definition at line 131 of file nsCSIDtoCharsetName.cpp.

#define CS_MAC_GREEK   (SINGLEBYTE | 42) /* 42 */

Definition at line 133 of file nsCSIDtoCharsetName.cpp.

#define CS_MAC_ROMAN   (SINGLEBYTE | 6) /* 6 */

Definition at line 92 of file nsCSIDtoCharsetName.cpp.

#define CS_MAC_TURKISH   (SINGLEBYTE | 46) /* 46 */

Definition at line 139 of file nsCSIDtoCharsetName.cpp.

#define CS_NPC   (MULTIBYTE | 36) /* 292 */

Definition at line 126 of file nsCSIDtoCharsetName.cpp.

#define CS_SJIS   (MULTIBYTE | 4) /* 260 */

Definition at line 85 of file nsCSIDtoCharsetName.cpp.

#define CS_SJIS_AUTO   (CS_AUTO|MULTIBYTE | 4) /* 2308 */

Definition at line 89 of file nsCSIDtoCharsetName.cpp.

#define CS_SPACE   0x0400 /* 0000 0100 0000 0000 = 1024 */

Definition at line 70 of file nsCSIDtoCharsetName.cpp.

#define CS_SYMBOL   (SINGLEBYTE | 21) /* 21 */

Definition at line 111 of file nsCSIDtoCharsetName.cpp.

#define CS_T61   (MULTIBYTE | 53) /* This line should not merged into 5.0 */

Definition at line 146 of file nsCSIDtoCharsetName.cpp.

#define CS_TIS620   (SINGLEBYTE | 29) /* 29 */

Definition at line 119 of file nsCSIDtoCharsetName.cpp.

#define CS_UCS2   (WIDECHAR | 32) /* 810 */

Definition at line 122 of file nsCSIDtoCharsetName.cpp.

#define CS_UCS2_SWAP   (WIDECHAR | 51) /* 819 */

Definition at line 144 of file nsCSIDtoCharsetName.cpp.

#define CS_UCS4   (WIDECHAR | 33) /* 811 */

Definition at line 123 of file nsCSIDtoCharsetName.cpp.

#define CS_UNKNOWN   (SINGLEBYTE | 255) /* 255 */

Definition at line 164 of file nsCSIDtoCharsetName.cpp.

#define CS_USER_DEFINED_ENCODING   (SINGLEBYTE | 254) /* 254 */

Definition at line 163 of file nsCSIDtoCharsetName.cpp.

#define CS_USRDEF2   (SINGLEBYTE | 38) /* 38 */

Definition at line 128 of file nsCSIDtoCharsetName.cpp.

#define CS_UTF7   (STATEFUL | 35) /* 35 */

Definition at line 125 of file nsCSIDtoCharsetName.cpp.

#define CS_UTF8   (MULTIBYTE | 34) /* 290 */

Definition at line 124 of file nsCSIDtoCharsetName.cpp.

#define CS_X_BIG5   (MULTIBYTE | 37) /* 293 */

Definition at line 127 of file nsCSIDtoCharsetName.cpp.

#define INTL_CHAR_SET_MAX   67 /* must be highest + 1 */

Definition at line 161 of file nsCSIDtoCharsetName.cpp.

Definition at line 67 of file nsCSIDtoCharsetName.cpp.

Value:
(   (((x)&0xFF)== (CS_UCS2&0xFF)) \
                      || (((x)&0xFF)== (CS_UTF8&0xFF)) \
                      || (((x)&0xFF)== (CS_UTF7&0xFF)) )

Definition at line 167 of file nsCSIDtoCharsetName.cpp.

#define IS_UTF8_CSID (   x)    (((x)&0xFF)== (CS_UTF8&0xFF))

Definition at line 166 of file nsCSIDtoCharsetName.cpp.

#define MAX_CSNAME   64

Definition at line 183 of file nsCSIDtoCharsetName.cpp.

#define MULTIBYTE   0x0100 /* 0000 0001 0000 0000 = 256 */

Definition at line 58 of file nsCSIDtoCharsetName.cpp.

#define SINGLEBYTE   0x0000 /* 0000 0000 0000 0000 = 0 */

Definition at line 57 of file nsCSIDtoCharsetName.cpp.

#define STATEFUL   0x0200 /* 0000 0010 0000 0000 = 512 */

Definition at line 59 of file nsCSIDtoCharsetName.cpp.

#define WIDECHAR   0x0300 /* 0000 0011 0000 0000 = 768 */

Definition at line 60 of file nsCSIDtoCharsetName.cpp.


Typedef Documentation

typedef struct _csname2id_t csname2id_t

Function Documentation

Definition at line 471 of file nsCSIDtoCharsetName.cpp.

{
  const char *charset = INTL_CsidToCharsetNamePt(csid);

  return *charset ? charset : "ISO-8859-1";
}

Here is the call graph for this function:

Here is the caller graph for this function:

static const char* INTL_CsidToCharsetNamePt ( PRUint16  csid) [static]

Definition at line 452 of file nsCSIDtoCharsetName.cpp.

{
       csname2id_t   *csn2idp;

       csid &= ~CS_AUTO;
       csn2idp = &csname2id_tbl[1];       /* First one is reserved, skip it. */
       csid &= 0xff;

       /* Linear search for charset string */
       while (*(csn2idp->cs_name) != '\0') {
              if ((csn2idp->cs_id & 0xff) == csid)
                     return csn2idp->cs_name;
              csn2idp++;
       }
       return "";
}

Here is the caller graph for this function:


Variable Documentation

Definition at line 197 of file nsCSIDtoCharsetName.cpp.