1 #ifndef __MULTIBUYTE_H__
2 #define __MULTIBUYTE_H__
5 * Multibyte library header ( psqlODBC Only )
11 /* PostgreSQL client encoding */
13 SQL_ASCII
= 0 /* SQL/ASCII */
14 ,EUC_JP
/* EUC for Japanese */
15 ,EUC_CN
/* EUC for Chinese */
16 ,EUC_KR
/* EUC for Korean */
17 ,EUC_TW
/* EUC for Taiwan */
19 ,UTF8
/* Unicode UTF-8 */
20 ,MULE_INTERNAL
/* Mule internal code */
21 ,LATIN1
/* ISO-8859 Latin 1 */
22 ,LATIN2
/* ISO-8859 Latin 2 */
23 ,LATIN3
/* ISO-8859 Latin 3 */
24 ,LATIN4
/* ISO-8859 Latin 4 */
25 ,LATIN5
/* ISO-8859 Latin 5 */
26 ,LATIN6
/* ISO-8859 Latin 6 */
27 ,LATIN7
/* ISO-8859 Latin 7 */
28 ,LATIN8
/* ISO-8859 Latin 8 */
29 ,LATIN9
/* ISO-8859 Latin 9 */
30 ,LATIN10
/* ISO-8859 Latin 10 */
31 ,WIN1256
/* Arabic Windows */
32 ,WIN1258
/* Vietnamese Windows */
33 ,WIN866
/* Alternativny Variant (MS-DOS CP866) */
34 ,WIN874
/* Thai Windows */
36 ,WIN1251
/* Cyrillic Windows */
37 ,WIN1252
/* Western Europe Windows */
38 ,ISO_8859_5
/* ISO-8859-5 */
39 ,ISO_8859_6
/* ISO-8859-6 */
40 ,ISO_8859_7
/* ISO-8859-7 */
41 ,ISO_8859_8
/* ISO-8859-8 */
42 ,WIN1250
/* Central Europe Windows */
43 ,WIN1253
/* Greek Windows */
44 ,WIN1254
/* Turkish Windows */
45 ,WIN1255
/* Hebrew Windows */
46 ,WIN1257
/* Baltic(North Europe) Windows */
51 ,GB18030
/* GB18030 */
55 #define MAX_CHARACTERSET_NAME 24
56 #define MAX_CHARACTER_LEN 6
59 // extern int multibyte_client_encoding; /* Multibyte client encoding. */
60 // extern int multibyte_status; /* Multibyte charcter status. */
62 // void multibyte_init(void);
63 // unsigned char *check_client_encoding(unsigned char *sql_string);
64 // int multibyte_char_check(unsigned char s);
65 // unsigned char *multibyte_strchr(const unsigned char *string, unsigned int c);
69 extern void CC_lookup_characterset(ConnectionClass
*self
);
70 extern const char *get_environment_encoding(const ConnectionClass
*conn
, const char *setenc
, const char *svrenc
, BOOL bStartup
);
72 extern int pg_CS_stat(int stat
,unsigned int charcter
,int characterset_code
);
73 extern int pg_CS_code(const UCHAR
*stat_string
);
74 extern const UCHAR
*pg_CS_name(int code
);
81 extern size_t pg_mbslen(int ccsc
, const UCHAR
*string
);
82 extern UCHAR
*pg_mbschr(int ccsc
, const UCHAR
*string
, unsigned int character
);
83 extern UCHAR
*pg_mbsinc(int ccsc
, const UCHAR
*current
);
85 /* Old Type Compatible */
93 #define ENCODE_STATUS(enc) ((enc).ccst)
95 void encoded_str_constr(encoded_str
*encstr
, int ccsc
, const char *str
);
96 #define make_encoded_str(encstr, conn, str) encoded_str_constr(encstr, conn->ccsc, str)
97 extern int encoded_nextchar(encoded_str
*encstr
);
98 extern ssize_t
encoded_position_shift(encoded_str
*encstr
, size_t shift
);
99 extern int encoded_byte_check(encoded_str
*encstr
, size_t abspos
);
100 /* #define check_client_encoding(X) pg_CS_name(pg_CS_code(X)) */
101 UCHAR
*check_client_encoding(const UCHAR
*sql_string
);
102 #endif /* __MULTIBUYTE_H__ */