Back to index

im-sdk  12.3.91
encode.h
Go to the documentation of this file.
00001 #ifndef _ENCODE_H_
00002 #define _ENCODE_H_
00003 enum encode_id_list {
00004        ENCODE_ERROR = -1,
00005        ENCODE_GB2312 = 0,
00006        ENCODE_GBK,
00007        ENCODE_GB18030,
00008        ENCODE_BIG5,
00009        ENCODE_EUC_TW,
00010        ENCODE_BIG5HK,
00011        ENCODE_EUC_TH,
00012        ENCODE_EUC_KO,
00013        ENCODE_UTF8,
00014        ENCODES_NUM
00015 };
00016 
00017 enum lang_group_list {
00018        LANG_ERROR = -1,
00019        LANG_ZH_CN = 0,
00020        LANG_ZH_TW,
00021        LANG_ZH_HK,
00022        LANG_TH_TH,
00023        LANG_KO_KR,
00024        LANGS_NUM,
00025 };
00026 
00027 extern char *get_langname_from_langid(int langid);
00028 extern char *get_langname_from_locale(char *locale);
00029 extern char *get_langname_from_encodeid(int encodeid);
00030 extern int get_langid_from_locale(char *locale);
00031 extern int get_langid_from_localeid(int localeid);
00032 extern int get_encodeid_from_name(char *name);
00033 extern int get_encodeid_from_locale(char *locale);
00034 extern char *get_name_from_encodeid(int encode_id);
00035 extern char *get_default_locale_from_locale(char *locale);
00036 extern int  get_char_len_by_encodeid(int encode_id, unsigned char *ch_ptr);
00037 extern int is_valid_code(int encode_id, unsigned char *int_code, int code_len);
00038 
00039 extern int Convert_Native_To_UTF8(int encode_id, char *from_buf, size_t from_left,
00040                         char **to_buf, size_t * to_left);
00041 extern int Convert_UTF8_To_Native(int encode_id, char *from_buf, size_t from_left,
00042                         char **to_buf, size_t * to_left);
00043 extern int Convert_Native_To_UTF16(int encode_id, char *from_buf, size_t from_left,
00044                         char **to_buf, size_t *to_left);
00045 extern int Convert_UTF16_To_Native(int encode_id, char *from_buf, size_t from_left,
00046                         char **to_buf, size_t * to_left);
00047 
00048 #endif /* _ENCODE_H_ */
00049