Back to index

im-sdk  12.3.91
Classes | Defines | Typedefs | Functions | Variables
encode.c File Reference
#include <stdio.h>
#include <errno.h>
#include <iconv.h>
#include <strings.h>
#include <X11/Xmd.h>
#include "encode.h"

Go to the source code of this file.

Classes

struct  _LangGroup_Info
struct  _Encode_Info

Defines

#define GB2312_CODESET_NAME   "GB2312"
#define GBK_CODESET_NAME   "GBK"
#define GB18030_CODESET_NAME   "GB18030"
#define BIG5_CODESET_NAME   "BIG5"
#define EUC_TW_CODESET_NAME   "EUC-TW"
#define BIG5HK_CODESET_NAME   "BIG5-HKSCS"
#define EUC_TH_CODESET_NAME   "TIS620"
#define EUC_KO_CODESET_NAME   "EUC-KR"
#define UTF8_CODESET_NAME   "UTF-8"
#define UNKNOWN_ENCODE   "UNKNOWN"
#define UTF16_STRLEN   1024

Typedefs

typedef struct _LangGroup_Info LangGroup_Info
typedef struct _Encode_Info Encode_Info

Functions

char * get_langname_from_langid (int langid)
char * get_langname_from_locale (char *locale)
char * get_langname_from_encodeid (int encodeid)
int get_langid_from_locale (char *locale)
int get_langid_from_localeid (int localeid)
int get_encodeid_from_name (char *name)
int get_encodeid_from_locale (char *locale)
char * get_name_from_encodeid (int encode_id)
char * get_default_locale_from_locale (char *locale)
int get_char_len_by_encodeid (int encode_id, unsigned char *ch_ptr)
int get_char_count_by_encodeid (int encode_id, unsigned char *ch_ptr, int *char_count)
int is_valid_code (int encode_id, unsigned char *int_code, int code_len)
int is_valid_encode_string (int encode_id, unsigned char *hzstr, int hzlen)
int Convert_Native_To_UTF8 (int encode_id, char *from_buf, size_t from_left, char **to_buf, size_t *to_left)
int Convert_UTF8_To_Native (int encode_id, char *from_buf, size_t from_left, char **to_buf, size_t *to_left)
int Convert_Native_To_UTF16 (int encode_id, char *from_buf, size_t from_left, char **to_buf, size_t *to_left)
int Convert_UTF16_To_Native (int encode_id, char *from_buf, size_t from_left, char **to_buf, size_t *to_left)

Variables

int zh_CN_encodes []
int zh_TW_encodes []
int zh_HK_encodes []
int th_TH_encodes []
int ko_KR_encodes []
char * zh_CN_locales []
char * zh_TW_locales []
char * zh_HK_locales []
char * th_TH_locales []
char * ko_KR_locales []
LangGroup_Info langgroup_info [LANGS_NUM]
char * GB2312_names []
char * GBK_names []
char * GB18030_names []
char * BIG5_names []
char * EUC_TW_names []
char * BIG5HK_names []
char * EUC_TH_names []
char * EUC_KO_names []
char * UTF8_names []
char * GB2312_locales []
char * GBK_locales []
char * GB18030_locales []
char * BIG5_locales []
char * EUC_TW_locales []
char * BIG5HK_locales []
char * EUC_TH_locales []
char * EUC_KO_locales []
char * UTF8_locales []
Encode_Info encode_info [ENCODES_NUM+1]
iconv_t fd_iconv_UTF8_to_UTF16 = NULL
iconv_t fd_iconv_UTF16_to_UTF8 = NULL

Class Documentation

struct _LangGroup_Info

Definition at line 50 of file encode.c.

Class Members
int lang_id
char * lang_name
int * support_encodes
char ** support_locales
struct _Encode_Info

Definition at line 169 of file encode.c.

Class Members
char ** called_names
int encode_id
iconv_t fd_iconv_from_utf8
iconv_t fd_iconv_to_utf8
char * iconv_codeset_name
char ** support_locales

Define Documentation

#define BIG5_CODESET_NAME   "BIG5"

Definition at line 299 of file encode.c.

#define BIG5HK_CODESET_NAME   "BIG5-HKSCS"

Definition at line 301 of file encode.c.

#define EUC_KO_CODESET_NAME   "EUC-KR"

Definition at line 303 of file encode.c.

#define EUC_TH_CODESET_NAME   "TIS620"

Definition at line 302 of file encode.c.

#define EUC_TW_CODESET_NAME   "EUC-TW"

Definition at line 300 of file encode.c.

#define GB18030_CODESET_NAME   "GB18030"

Definition at line 298 of file encode.c.

#define GB2312_CODESET_NAME   "GB2312"

Definition at line 296 of file encode.c.

#define GBK_CODESET_NAME   "GBK"

Definition at line 297 of file encode.c.

#define UNKNOWN_ENCODE   "UNKNOWN"

Definition at line 307 of file encode.c.

#define UTF16_STRLEN   1024

Definition at line 857 of file encode.c.

#define UTF8_CODESET_NAME   "UTF-8"

Definition at line 304 of file encode.c.


Typedef Documentation

typedef struct _Encode_Info Encode_Info

Function Documentation

int Convert_Native_To_UTF16 ( int  encode_id,
char *  from_buf,
size_t  from_left,
char **  to_buf,
size_t *  to_left 
)

Definition at line 859 of file encode.c.

{
       char   *ip;
       char          *op;
       size_t        ileft, oleft;

       char          *codeset;
       iconv_t              fd_iconv_native_to_utf8;

       size_t        ret = 0;
       int           skip_native_to_utf8_iconv = 0;

       if (encode_id < 0 || encode_id >= ENCODES_NUM)
              return(-1);

       if ( (from_left < 0) || (*to_left < 0) )
              return(-1);

       /* Initialize the iconv of utf8_to_ucs2 */
       if (fd_iconv_UTF8_to_UTF16 == (iconv_t)-1 )
               return(-1);

       if (fd_iconv_UTF8_to_UTF16 == NULL) {
              fd_iconv_UTF8_to_UTF16 = iconv_open("UTF-16", "UTF-8");
              if (fd_iconv_UTF8_to_UTF16 == (iconv_t)-1 )
                     return(-1);
       }

       if (encode_id == ENCODE_UTF8)
              skip_native_to_utf8_iconv = 1;

       ip = (char *) from_buf;
       ileft = from_left;

       op = *((char **) to_buf);
       oleft = *to_left;

       if (!skip_native_to_utf8_iconv) {
              char          buffer[UTF16_STRLEN];   /* Fix me! */
              const size_t  buf_len = UTF16_STRLEN;
              char          *src, *dst;
              size_t        src_len, dst_len;

              /* Initialize the iconv of native_to_utf8 */
              fd_iconv_native_to_utf8 = encode_info[encode_id].fd_iconv_to_utf8;
              if (fd_iconv_native_to_utf8 == (iconv_t)-1) return(-1);

              if (fd_iconv_native_to_utf8 == NULL) {
                     codeset = encode_info[encode_id].iconv_codeset_name;
                     fd_iconv_native_to_utf8 = iconv_open("UTF-8", codeset);
                     encode_info[encode_id].fd_iconv_to_utf8 = fd_iconv_native_to_utf8;
                     if ( fd_iconv_native_to_utf8 == (iconv_t) -1 )
                            return(-1);
              }

              while ((ileft > 0) && (oleft > 0)) {
                     dst = buffer;
                     dst_len = buf_len;
                     ret = iconv(fd_iconv_native_to_utf8, &ip, &ileft, (char **) &dst, &dst_len);
                     if (ret == -1) {
                            return(-1);
                     }
                     src = buffer;
                     src_len = buf_len - dst_len;
                     ret = iconv(fd_iconv_UTF8_to_UTF16, (char **) &src, &src_len, &op, &oleft);
                     if (ret == -1) {
                            return(-1);
                     }
              }

       } else {
              ret = iconv(fd_iconv_UTF8_to_UTF16, &ip, &ileft, &op, &oleft);
              if (ret == -1) {
                      return(-1);
              }
       }

       if (0xFEFF == **((CARD16 **) to_buf)) {
              memmove(*to_buf, *to_buf + 2, *to_left - oleft - 2);
              *to_left = (oleft + 2);
       } else {
              *to_left = oleft;
       }

       return(0);
}

Here is the caller graph for this function:

int Convert_Native_To_UTF8 ( int  encode_id,
char *  from_buf,
size_t  from_left,
char **  to_buf,
size_t *  to_left 
)

Definition at line 758 of file encode.c.

{
       char   *ip;
       char          *op;
       size_t        ileft, oleft;
       iconv_t              fd_iconv;
       char          *codeset;
       size_t        ret = 0;
       
       if (encode_id < 0 || encode_id >= ENCODES_NUM)
              return(-1);

       if ( (from_left < 0) || (*to_left < 0) )
              return(-1);

       ip = (char *) from_buf;
       ileft = from_left;

       op = *((char **) to_buf);
       oleft = *to_left;

       if (encode_id == ENCODE_UTF8) {
              if (ileft > oleft)
                     return(-1);
              memcpy(op, ip, ileft);
              *to_left = oleft - ileft;
              return(0);
       }

       fd_iconv = encode_info[encode_id].fd_iconv_to_utf8;
       if (fd_iconv == (iconv_t)-1) return(-1);

       if (fd_iconv == NULL) {
              codeset = encode_info[encode_id].iconv_codeset_name;
              fd_iconv = iconv_open("UTF-8", codeset);
              encode_info[encode_id].fd_iconv_to_utf8 = fd_iconv;
              if ( fd_iconv == (iconv_t) -1 )
                     return(-1);
       }

       ret = iconv(fd_iconv, &ip, &ileft, &op, &oleft);
       if (ret == -1) {
              return(-1);
       }
       *to_left = oleft;
       return(0);

}

Here is the caller graph for this function:

int Convert_UTF16_To_Native ( int  encode_id,
char *  from_buf,
size_t  from_left,
char **  to_buf,
size_t *  to_left 
)

Definition at line 947 of file encode.c.

{
       char   *ip;
       char          *op;
       size_t        ileft, oleft;
       char          *codeset;
       iconv_t              fd_iconv_utf8_to_native;

       size_t        ret = 0;
       int           skip_utf8_to_native_iconv = 0;

       if (encode_id < 0 || encode_id >= ENCODES_NUM)
              return(-1);

       if ( (from_left < 0) || (*to_left < 0) )
              return(-1);

       /* Initialize the iconv of utf8_to_ucs2 */
       if (fd_iconv_UTF16_to_UTF8 == (iconv_t)-1 )
               return(-1);

       if (fd_iconv_UTF16_to_UTF8 == NULL) {
              fd_iconv_UTF16_to_UTF8 = iconv_open("UTF-8", "UTF-16");
              if (fd_iconv_UTF16_to_UTF8 == (iconv_t)-1 )
                     return(-1);
       }

       if (encode_id == ENCODE_UTF8)
              skip_utf8_to_native_iconv = 1;

       ip = (char *) from_buf;
       ileft = from_left;

       op = *((char **) to_buf);
       oleft = *to_left;

       if (!skip_utf8_to_native_iconv) {
              char          buffer[UTF16_STRLEN];   /* Fix me! */
              const size_t  buf_len = UTF16_STRLEN;
              char          *src, *dst;
              size_t        src_len, dst_len;

              /* Initialize the iconv of native_to_utf8 */
              fd_iconv_utf8_to_native = encode_info[encode_id].fd_iconv_from_utf8;
              if (fd_iconv_utf8_to_native == (iconv_t)-1) return(-1);

              if (fd_iconv_utf8_to_native == NULL) {
                     codeset = encode_info[encode_id].iconv_codeset_name;
                     fd_iconv_utf8_to_native = iconv_open(codeset, "UTF-8");
                     encode_info[encode_id].fd_iconv_from_utf8 = fd_iconv_utf8_to_native;
                     if ( fd_iconv_utf8_to_native == (iconv_t) -1 )
                            return(-1);
              }

              while ((ileft > 0) && (oleft > 0)) {
                     dst = buffer;
                     dst_len = buf_len;
                     ret = iconv(fd_iconv_UTF16_to_UTF8, &ip, &ileft, (char **) &dst, &dst_len);
                     if (ret == -1) {
                            return(-1);
                     }
                     src = buffer;
                     src_len = buf_len - dst_len;
                     ret = iconv(fd_iconv_utf8_to_native, (char **) &src, &src_len, &op, &oleft);
                     if (ret == -1) {
                            return(-1);
                     }
              }

       } else {
              ret = iconv(fd_iconv_UTF16_to_UTF8, &ip, &ileft, &op, &oleft);
              if (ret == -1) {
                      return(-1);
              }
       }

       *to_left = oleft;

       return(0);
}

Here is the caller graph for this function:

int Convert_UTF8_To_Native ( int  encode_id,
char *  from_buf,
size_t  from_left,
char **  to_buf,
size_t *  to_left 
)

Definition at line 808 of file encode.c.

{
       char   *ip;
       char          *op;
       size_t        ileft, oleft;
       iconv_t              fd_iconv;
       char          *codeset;
       size_t        ret = 0;
       
       if (encode_id < 0 || encode_id >= ENCODES_NUM)
              return(-1);

       if ( (from_left < 0) || (*to_left < 0) )
              return(-1);

       ip = (char *) from_buf;
       ileft = from_left;

       op = *((char **) to_buf);
       oleft = *to_left;

       if (encode_id == ENCODE_UTF8) {
              if (ileft > oleft)
                     return(-1);
              memcpy(op, ip, ileft);
              *to_left = oleft - ileft;
              return(0);
       }

       fd_iconv = encode_info[encode_id].fd_iconv_from_utf8;
       if (fd_iconv == (iconv_t)-1) return(-1);

       if (fd_iconv == NULL) {
              codeset = encode_info[encode_id].iconv_codeset_name;
              fd_iconv = iconv_open(codeset, "UTF-8");
              encode_info[encode_id].fd_iconv_from_utf8 = fd_iconv;
              if ( fd_iconv == (iconv_t) -1 )
                     return(-1);
       }

       ret = iconv(fd_iconv, &ip, &ileft, &op, &oleft);
       if (ret == -1) {
              return(-1);
       }
       *to_left = oleft;
       return(0);
}

Here is the caller graph for this function:

int get_char_count_by_encodeid ( int  encode_id,
unsigned char *  ch_ptr,
int *  char_count 
)

Definition at line 608 of file encode.c.

{
       int str_len = strlen((char *)ch_ptr);
       int str_pos = 0;
       int char_len;
       unsigned char *pStr;

       *char_count = 0;
       while (str_pos < str_len) {
              pStr = ch_ptr + str_pos;
              char_len = get_char_len_by_encodeid(encode_id, pStr);
              if (str_pos + char_len <= str_len) {
                     (*char_count)++;
                     str_pos += char_len;
              } else {
                     return(-1);
              }
       }

       return(0);
}

Here is the call graph for this function:

int get_char_len_by_encodeid ( int  encode_id,
unsigned char *  ch_ptr 
)

Definition at line 581 of file encode.c.

{
       int ret = 2;  /* default character length */
       unsigned char code0, code1;

       code0 = ch_ptr[0];
       if (code0 < 0x80) return(1);

       if (encode_id == ENCODE_UTF8) {
              if (code0 > 0xe0)           /* 3 bytes */
                     ret = 3;
       } else if (encode_id == ENCODE_GB18030) {
              code1 = ch_ptr[1];
              if (code0 >=0x81 && code0 <= 0xFE) {
                     if (code1 >= 0x30 && code1 <= 0x39)
                            ret = 4;
              } 
       } else if (encode_id == ENCODE_EUC_TW) {
              if (code0 == 0x8e)          /* 4 bytes */
                     ret = 4;
       } else if (encode_id == ENCODE_EUC_TH) {
              ret = 1;
       }

       return(ret);
}

Here is the caller graph for this function:

char* get_default_locale_from_locale ( char *  locale)

Definition at line 556 of file encode.c.

{
       int encode_id, i, ret;
       char *s;

       ret = -1;
       for (encode_id = 0; encode_id < ENCODES_NUM; encode_id++) {
              i = 0;
              while (1) {
                     s = encode_info[encode_id].support_locales[i];
                     if (!s || !*s) break;
                     if (!strcasecmp(s, locale)) {
                            ret = encode_id;
                            break;
                     }
                     i++;
              }
              if (ret != -1) break;
       }
       
       if (ret == -1) return(NULL);

       return(encode_info[ret].support_locales[0]);
}
int get_encodeid_from_locale ( char *  locale)

Definition at line 523 of file encode.c.

{
       int encode_id, i, ret;
       char *s;
       
       ret = -1;
       for (encode_id = 0; encode_id < ENCODES_NUM; encode_id++) {
              i = 0;
              while (1) {
                     s = encode_info[encode_id].support_locales[i];
                     if (!s || !*s) break;
                     if (!strcasecmp(s, locale)) {
                            ret = encode_id;
                            break;
                     }
                     i++;
              }
              if (ret != -1) break;
       }

       if (ret == -1) ret = ENCODE_ERROR; /* return default encode */

       return(ret);  
}

Here is the caller graph for this function:

int get_encodeid_from_name ( char *  name)

Definition at line 500 of file encode.c.

{
       int encode_id, i, ret;
       char *s;
       
       ret = -1;
       for (encode_id = 0; encode_id < ENCODES_NUM; encode_id++) {
              i = 0;
              while (1) {
                     s = encode_info[encode_id].called_names[i];
                     if (!s || !*s) break;
                     if (!strcasecmp(s, name)) {
                            ret = encode_id;
                            break;
                     }
                     i++;
              }
              if (ret != -1) break;
       }
       if (ret == -1) ret = ENCODE_GB2312; /* return default encode */
       return(ret);  
}

Here is the caller graph for this function:

int get_langid_from_locale ( char *  locale)

Definition at line 449 of file encode.c.

{
       int lang_id, i, ret;
       char *s;

       ret = -1;
       for (lang_id = 0; lang_id < LANGS_NUM; lang_id++) {
              i = 0;
              while (1) {
                     s = langgroup_info[lang_id].support_locales[i];
                     if (!s || !*s) break;
                     if (!strcasecmp(s, locale)) {
                            ret = lang_id;
                            break;
                     }
                     i++;
              }
              if (ret != -1) break;
       }

       if (ret == -1) 
              ret = 0;

       return(ret);
}
int get_langid_from_localeid ( int  localeid)

Definition at line 474 of file encode.c.

{
       int lang_id, i, ret;
       int support_encode;

       ret = -1;
       for (lang_id = 0; lang_id < LANGS_NUM; lang_id++) {
              i = 0;
              while (1) {
                     support_encode = langgroup_info[lang_id].support_encodes[i];
                     if (support_encode == ENCODE_ERROR) break;
                     if (localeid == support_encode) {
                            ret = lang_id;
                            break;
                     }
                     i++;
              }
              if (ret != -1) break;
       }

       if (ret == -1) 
              ret = 0;

       return(ret);
}

Here is the caller graph for this function:

char* get_langname_from_encodeid ( int  encodeid)

Definition at line 423 of file encode.c.

{
       int lang_id, i, ret;
       int support_encode;

       ret = -1;
       for (lang_id = 0; lang_id < LANGS_NUM; lang_id++) {
              i = 0;
              while (1) {
                     support_encode = langgroup_info[lang_id].support_encodes[i];
                     if (support_encode == ENCODE_ERROR) break;
                     if (encodeid == support_encode) {
                            ret = lang_id;
                            break;
                     }
                     i++;
              }
              if (ret != -1) break;
       }

       if (ret == -1) 
              ret = 0;

       return(langgroup_info[ret].lang_name);
}
char* get_langname_from_langid ( int  langid)

Definition at line 387 of file encode.c.

{
       int ret = langid;
       
       if (langid < 0 || langid >= LANGS_NUM) 
              ret = 0;

       return(langgroup_info[ret].lang_name);
}

Here is the caller graph for this function:

char* get_langname_from_locale ( char *  locale)

Definition at line 397 of file encode.c.

{
       int lang_id, i, ret;
       char *s;

       ret = -1;
       for (lang_id = 0; lang_id < LANGS_NUM; lang_id++) {
              i = 0;
              while (1) {
                     s = langgroup_info[lang_id].support_locales[i];
                     if (!s || !*s) break;
                     if (!strcasecmp(s, locale)) {
                            ret = lang_id;
                            break;
                     }
                     i++;
              }
              if (ret != -1) break;
       }

       if (ret == -1) 
              ret = 0;

       return(langgroup_info[ret].lang_name);
}
char* get_name_from_encodeid ( int  encode_id)

Definition at line 548 of file encode.c.

{
       if (encode_id >= 0 && encode_id <= ENCODES_NUM)
              return(encode_info[encode_id].called_names[0]);
       else
              return(NULL);
}

Here is the caller graph for this function:

int is_valid_code ( int  encode_id,
unsigned char *  int_code,
int  code_len 
)

Definition at line 630 of file encode.c.

{
       unsigned char code0, code1, code2, code3;
       
       code0 = int_code[0];
       code1 = int_code[1];

       switch (encode_id) {
              case ENCODE_GB2312:
                     if (code0 < 0xA1 || code0 > 0xFE)
                            return (-1);
                     if (code1 < 0xA1 || code1 > 0xFE)
                            return (-1);
                     break;
                     
              case ENCODE_GBK:
                     if (code0 < 0x81 || code0 > 0xFE)
                            return (-1);
                     if (code1 < 0x40 || code1 > 0xFE || code1 == 0x7F)
                            return (-1);
                     break;

              case ENCODE_GB18030:
                     if (code_len == 2) {
                            if (code0 < 0x81 || code0 > 0xFE)
                                   return (-1);
                            if (code1 < 0x40 || code1 > 0xFE || code1 == 0x7F)
                                   return (-1);
                     } else if (code_len == 4) {
                            code2 = int_code[2];
                            code3 = int_code[3];
                            if (code0 < 0x81 || code0 > 0xFE)
                                   return (-1);
                            if (code1 < 0x30 || code1 > 0x39)
                                   return (-1);
                            if (code2 < 0x81 || code2 > 0xFE)
                                   return (-1);
                            if (code3 < 0x30 || code3 > 0x39)
                                   return (-1);
                     }
                     break;

              case ENCODE_BIG5:
#if 0
                     /* define in lcbig5.c */
                     if ((code0 >= 0xA1) && code0 <= 0xC5) || (code0 >= 0xC9 && code0 <= 0xF9)) {
                            if (code1 < 0x40 || code1 == 0xFF || (code1 >= 0x7F && code1 <= 0xA0))
                                   return (-1);
                            else
                                   return (0);
                     } else {
                            if (code0 == 0xC6 && (code1 >= 0x40 && code1 <= 0x7E))
                                   return (0);
                            else
                                   return (-1);
                     }
#endif
                                   
                     if (code0 < 0xA1 || code0 > 0xFE)
                            return (-1);
                     if (code1 < 0x40 || code1 > 0xFE)
                            return (-1);
                     if (code1 > 0x7E && code1 < 0xA1)
                            return (-1);
                     break;

              case ENCODE_EUC_TW:
                     if (code_len == 2) {
                            if (code0 < 0x80 || code1 <0x80)
                                   return (-1);
                     } if (code_len == 4) {
                            code2 = int_code[2];
                            code3 = int_code[3];
                            if (code0 != 0x8E)
                                   return(-1);
                            if (code1 < 0x80 || code2 < 0x80 || code3 < 0x80)
                                   return(-1);
                     }
                     break;

              case ENCODE_BIG5HK:
                     if (code0 < 0x81 || code0 > 0xFE)
                            return (-1);
                     if (code1 < 0x40 || code1 > 0xFE)
                            return (-1);
                     break;

              case ENCODE_EUC_KO:
                     if (code0 < 0xA1 || code0 > 0xFE)
                            return (-1);
                     if (code1 < 0xA1 || code1 > 0xFE)
                            return (-1);
                     break;

              case ENCODE_UTF8:
                     break;
       }
       return(0);
}

Here is the caller graph for this function:

int is_valid_encode_string ( int  encode_id,
unsigned char *  hzstr,
int  hzlen 
)

Definition at line 730 of file encode.c.

{
       int i, char_len, ret;
       unsigned char *ptr;

       i = 0;
       while (i < hzlen) {
              ptr = hzstr + i;
              if (*ptr < 0x80) {
                     if (*ptr == 0x3f && i < hzlen-1) {
                            if (*(ptr+1) == 0x3f)
                                   return(-1);
                     }

                     i++;
              } else {
                     char_len = get_char_len_by_encodeid(encode_id, ptr);
                     ret = is_valid_code(encode_id, ptr, char_len);
                     if (ret == -1)
                            return(-1);
                     i += char_len;
              }
       }

       return (0);
}

Here is the caller graph for this function:


Variable Documentation

char* BIG5_locales[]
Initial value:
 {
       "zh_TW.BIG5",
       "zh_TW.UTF-8",
       "zh_TW.utf8",    
       "zh_TW",
       NULL
}

Definition at line 249 of file encode.c.

char* BIG5_names[]
Initial value:
 {
       "BIG5",
       NULL
}

Definition at line 195 of file encode.c.

char* BIG5HK_locales[]
Initial value:
 {
       "zh_HK.big5hkscs",
       "zh_HK.BIG5HK",
       "zh_HK.UTF-8",
       "zh_HK.utf8",    
       NULL
}

Definition at line 264 of file encode.c.

char* BIG5HK_names[]
Initial value:
 {
       "BIG5HK",
       "BIG5HKSCS",
       NULL
}

Definition at line 205 of file encode.c.

Definition at line 309 of file encode.c.

char* EUC_KO_locales[]
Initial value:
 {
       "ko_KR.EUC",
       "ko_KR.UTF-8",
       "ko_KR.utf8",    
       NULL
}

Definition at line 280 of file encode.c.

char* EUC_KO_names[]
Initial value:
 {
       "EUC_KO",
       NULL
}

Definition at line 216 of file encode.c.

char* EUC_TH_locales[]
Initial value:
 {
       "th_TH",
       "th_TH.TIS620",
       "th_TH.UTF-8",
       "th_TH.utf8",    
       NULL
}

Definition at line 272 of file encode.c.

char* EUC_TH_names[]
Initial value:
 {
       "EUC_TH",
       NULL
}

Definition at line 211 of file encode.c.

char* EUC_TW_locales[]
Initial value:
 {
       "zh_TW.eucTW",
       "zh_TW.EUC",
       "zh_TW",
       NULL
}

Definition at line 257 of file encode.c.

char* EUC_TW_names[]
Initial value:
 {
       "EUC_TW",
       NULL
}

Definition at line 200 of file encode.c.

Definition at line 385 of file encode.c.

Definition at line 384 of file encode.c.

char* GB18030_locales[]
Initial value:
 {
       "zh_CN.GB18030",
       "zh_CN.UTF-8",
       "zh_CN.utf8",    
       NULL
}

Definition at line 242 of file encode.c.

char* GB18030_names[]
Initial value:
 {
       "GB18030",
       NULL
}

Definition at line 190 of file encode.c.

char* GB2312_locales[]
Initial value:
 {
       "zh_CN.EUC",
       "zh_CN",
       "zh",
       NULL
}

Definition at line 229 of file encode.c.

char* GB2312_names[]
Initial value:
 {
       "GB2312",
       "GB",
       NULL
}

Definition at line 179 of file encode.c.

char* GBK_locales[]
Initial value:
 {
       "zh_CN.GBK",
       "zh.GBK",
       NULL
}

Definition at line 236 of file encode.c.

char* GBK_names[]
Initial value:
 {
       "GBK",
       NULL
}

Definition at line 185 of file encode.c.

Initial value:

Definition at line 81 of file encode.c.

char* ko_KR_locales[]
Initial value:
 {
       "ko",
       "ko_KR.EUC",
       "ko.UTF-8",
       "ko_KR.utf8",    
       NULL
}

Definition at line 128 of file encode.c.

Definition at line 136 of file encode.c.

Initial value:

Definition at line 76 of file encode.c.

char* th_TH_locales[]
Initial value:
 {
       "th_TH.TIS620",
       "th_TH.ISO8859-11",
       "th_TH.UTF-8",
       "th_TH.utf8",    
       "th_TH",
       "th",
       NULL
}

Definition at line 118 of file encode.c.

char* UTF8_locales[]
Initial value:
 {
       "zh_TW.UTF-8",
       "zh_TW.utf8",    
       "zh_HK.UTF-8",
       "zh_HK.utf8",    
       NULL
}

Definition at line 287 of file encode.c.

char* UTF8_names[]
Initial value:
 {
       "UTF-8",
       "UTF_8",
       "UTF8",
       NULL
}

Definition at line 221 of file encode.c.

Initial value:

Definition at line 58 of file encode.c.

char* zh_CN_locales[]
Initial value:
 {
       "zh_CN",
       "zh_CN.EUC",
       "zh_CN.GBK",
       "zh_CN.GB18030",
       "zh_CN.UTF-8",
       "zh_CN.utf8",    
       "zh.GBK",
       "zh.UTF-8",
       "zh",
       NULL
}

Definition at line 87 of file encode.c.

Initial value:

Definition at line 71 of file encode.c.

char* zh_HK_locales[]
Initial value:
 {
       "zh_HK.big5hkscs",
       "zh_HK.BIG5HK",
       "zh_HK.UTF-8",
       "zh_HK.utf8",    
       NULL
}

Definition at line 110 of file encode.c.

Initial value:

Definition at line 65 of file encode.c.

char* zh_TW_locales[]
Initial value:
 {
       "zh_TW.eucTW",
       "zh_TW.EUC",
       "zh_TW.BIG5",
       "zh_TW.UTF-8",
       "zh_TW.utf8",    
       "zh_TW",
       NULL
}

Definition at line 100 of file encode.c.