1 /*
2  * "streamable kanji code filter and converter"
3  * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved.
4  *
5  * LICENSE NOTICES
6  *
7  * This file is part of "streamable kanji code filter and converter",
8  * which is distributed under the terms of GNU Lesser General Public
9  * License (version 2) as published by the Free Software Foundation.
10  *
11  * This software is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with "streamable kanji code filter and converter";
18  * if not, write to the Free Software Foundation, Inc., 59 Temple Place,
19  * Suite 330, Boston, MA  02111-1307  USA
20  *
21  * The author of this file:
22  *
23  */
24 /*
25  * The source code included in this files was separated from mbfilter.h
26  * by Moriyoshi Koizumi <moriyoshi@php.net> on 20 Dec 2002. The file
27  * mbfilter.h is included in this package .
28  *
29  */
30 
31 #ifndef MBFL_ENCODING_H
32 #define MBFL_ENCODING_H
33 
34 #include "mbfl_defs.h"
35 
36 enum mbfl_no_encoding {
37 	mbfl_no_encoding_invalid = -1,
38 	mbfl_no_encoding_pass,
39 	mbfl_no_encoding_auto,
40 	mbfl_no_encoding_wchar,
41 	mbfl_no_encoding_byte2be,
42 	mbfl_no_encoding_byte2le,
43 	mbfl_no_encoding_byte4be,
44 	mbfl_no_encoding_byte4le,
45 	mbfl_no_encoding_base64,
46 	mbfl_no_encoding_uuencode,
47 	mbfl_no_encoding_html_ent,
48 	mbfl_no_encoding_qprint,
49 	mbfl_no_encoding_7bit,
50 	mbfl_no_encoding_8bit,
51 	mbfl_no_encoding_charset_min,
52 	mbfl_no_encoding_ucs4,
53 	mbfl_no_encoding_ucs4be,
54 	mbfl_no_encoding_ucs4le,
55 	mbfl_no_encoding_ucs2,
56 	mbfl_no_encoding_ucs2be,
57 	mbfl_no_encoding_ucs2le,
58 	mbfl_no_encoding_utf32,
59 	mbfl_no_encoding_utf32be,
60 	mbfl_no_encoding_utf32le,
61 	mbfl_no_encoding_utf16,
62 	mbfl_no_encoding_utf16be,
63 	mbfl_no_encoding_utf16le,
64 	mbfl_no_encoding_utf8,
65 	mbfl_no_encoding_utf8_docomo,
66 	mbfl_no_encoding_utf8_kddi_a,
67 	mbfl_no_encoding_utf8_kddi_b,
68 	mbfl_no_encoding_utf8_sb,
69 	mbfl_no_encoding_utf7,
70 	mbfl_no_encoding_utf7imap,
71 	mbfl_no_encoding_ascii,
72 	mbfl_no_encoding_euc_jp,
73 	mbfl_no_encoding_eucjp2004,
74 	mbfl_no_encoding_sjis,
75 	mbfl_no_encoding_eucjp_win,
76 	mbfl_no_encoding_sjis_open,
77  	mbfl_no_encoding_sjis_docomo,
78  	mbfl_no_encoding_sjis_kddi,
79  	mbfl_no_encoding_sjis_sb,
80  	mbfl_no_encoding_sjis_mac,
81 	mbfl_no_encoding_sjis2004,
82 	mbfl_no_encoding_cp932,
83 	mbfl_no_encoding_cp51932,
84 	mbfl_no_encoding_jis,
85 	mbfl_no_encoding_2022jp,
86 	mbfl_no_encoding_2022jp_2004,
87 	mbfl_no_encoding_2022jp_kddi,
88 	mbfl_no_encoding_2022jpms,
89 	mbfl_no_encoding_gb18030,
90 	mbfl_no_encoding_cp1252,
91 	mbfl_no_encoding_cp1254,
92 	mbfl_no_encoding_8859_1,
93 	mbfl_no_encoding_8859_2,
94 	mbfl_no_encoding_8859_3,
95 	mbfl_no_encoding_8859_4,
96 	mbfl_no_encoding_8859_5,
97 	mbfl_no_encoding_8859_6,
98 	mbfl_no_encoding_8859_7,
99 	mbfl_no_encoding_8859_8,
100 	mbfl_no_encoding_8859_9,
101 	mbfl_no_encoding_8859_10,
102 	mbfl_no_encoding_8859_13,
103 	mbfl_no_encoding_8859_14,
104 	mbfl_no_encoding_8859_15,
105 	mbfl_no_encoding_euc_cn,
106 	mbfl_no_encoding_cp936,
107 	mbfl_no_encoding_euc_tw,
108 	mbfl_no_encoding_big5,
109 	mbfl_no_encoding_cp950,
110 	mbfl_no_encoding_euc_kr,
111 	mbfl_no_encoding_2022kr,
112 	mbfl_no_encoding_uhc,
113 	mbfl_no_encoding_hz,
114 	mbfl_no_encoding_cp1251,
115 	mbfl_no_encoding_cp866,
116 	mbfl_no_encoding_koi8r,
117 	mbfl_no_encoding_koi8u,
118 	mbfl_no_encoding_8859_16,
119 	mbfl_no_encoding_armscii8,
120 	mbfl_no_encoding_cp850,
121 	mbfl_no_encoding_jis_ms,
122 	mbfl_no_encoding_cp50220,
123 	mbfl_no_encoding_cp50220raw,
124 	mbfl_no_encoding_cp50221,
125 	mbfl_no_encoding_cp50222,
126 	mbfl_no_encoding_charset_max
127 };
128 
129 typedef enum mbfl_no_encoding mbfl_encoding_id;
130 
131 /*
132  * encoding
133  */
134 typedef struct _mbfl_encoding {
135 	enum mbfl_no_encoding no_encoding;
136 	const char *name;
137 	const char *mime_name;
138 	const char *(*aliases)[];
139 	const unsigned char *mblen_table;
140 	unsigned int flag;
141 } mbfl_encoding;
142 
143 MBFLAPI extern const mbfl_encoding * mbfl_name2encoding(const char *name);
144 MBFLAPI extern const mbfl_encoding * mbfl_no2encoding(enum mbfl_no_encoding no_encoding);
145 MBFLAPI extern enum mbfl_no_encoding mbfl_name2no_encoding(const char *name);
146 MBFLAPI extern const mbfl_encoding ** mbfl_get_supported_encodings();
147 MBFLAPI extern const char * mbfl_no_encoding2name(enum mbfl_no_encoding no_encoding);
148 MBFLAPI extern const char * mbfl_no2preferred_mime_name(enum mbfl_no_encoding no_encoding);
149 MBFLAPI extern int mbfl_is_support_encoding(const char *name);
150 
151 
152 #endif /* MBFL_ENCODING_H */
153