2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2007 Hiroyuki Yamamoto and the Claws Mail team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef __CODECONV_H__
21 #define __CODECONV_H__
30 typedef struct _CodeConverter CodeConverter;
95 typedef void (*CodeConvFunc) (gchar *outbuf, gint outlen, const gchar *inbuf);
99 CodeConvFunc code_conv_func;
104 #define CS_AUTO "AUTO"
105 #define CS_US_ASCII "US-ASCII"
106 #define CS_ANSI_X3_4_1968 "ANSI_X3.4-1968"
107 #define CS_UTF_8 "UTF-8"
108 #define CS_UTF_7 "UTF-7"
109 #define CS_ISO_8859_1 "ISO-8859-1"
110 #define CS_ISO_8859_2 "ISO-8859-2"
111 #define CS_ISO_8859_3 "ISO-8859-3"
112 #define CS_ISO_8859_4 "ISO-8859-4"
113 #define CS_ISO_8859_5 "ISO-8859-5"
114 #define CS_ISO_8859_6 "ISO-8859-6"
115 #define CS_ISO_8859_7 "ISO-8859-7"
116 #define CS_ISO_8859_8 "ISO-8859-8"
117 #define CS_ISO_8859_9 "ISO-8859-9"
118 #define CS_ISO_8859_10 "ISO-8859-10"
119 #define CS_ISO_8859_11 "ISO-8859-11"
120 #define CS_ISO_8859_13 "ISO-8859-13"
121 #define CS_ISO_8859_14 "ISO-8859-14"
122 #define CS_ISO_8859_15 "ISO-8859-15"
123 #define CS_BALTIC "BALTIC"
124 #define CS_CP1250 "CP1250"
125 #define CS_CP1251 "CP1251"
126 #define CS_CP1252 "CP1252"
127 #define CS_CP1253 "CP1253"
128 #define CS_CP1254 "CP1254"
129 #define CS_CP1255 "CP1255"
130 #define CS_CP1256 "CP1256"
131 #define CS_CP1257 "CP1257"
132 #define CS_CP1258 "CP1258"
133 #define CS_WINDOWS_1250 "Windows-1250"
134 #define CS_WINDOWS_1251 "Windows-1251"
135 #define CS_WINDOWS_1252 "Windows-1252"
136 #define CS_WINDOWS_1253 "Windows-1253"
137 #define CS_WINDOWS_1254 "Windows-1254"
138 #define CS_WINDOWS_1255 "Windows-1255"
139 #define CS_WINDOWS_1256 "Windows-1256"
140 #define CS_WINDOWS_1257 "Windows-1257"
141 #define CS_WINDOWS_1258 "Windows-1258"
142 #define CS_KOI8_R "KOI8-R"
143 #define CS_KOI8_T "KOI8-T"
144 #define CS_KOI8_U "KOI8-U"
145 #define CS_ISO_2022_JP "ISO-2022-JP"
146 #define CS_ISO_2022_JP_2 "ISO-2022-JP-2"
147 #define CS_ISO_2022_JP_3 "ISO-2022-JP-3"
148 #define CS_EUC_JP "EUC-JP"
149 #define CS_EUCJP "EUCJP"
150 #define CS_EUC_JP_MS "EUC-JP-MS"
151 #define CS_SHIFT_JIS "Shift_JIS"
152 #define CS_SHIFT__JIS "SHIFT-JIS"
153 #define CS_SJIS "SJIS"
154 #define CS_X_SJIS "X-SJIS"
155 #define CS_ISO_2022_KR "ISO-2022-KR"
156 #define CS_EUC_KR "EUC-KR"
157 #define CS_ISO_2022_CN "ISO-2022-CN"
158 #define CS_EUC_CN "EUC-CN"
159 #define CS_GB2312 "GB2312"
161 #define CS_X_GBK "X-GBK"
162 #define CS_EUC_TW "EUC-TW"
163 #define CS_BIG5 "Big5"
164 #define CS_BIG5_HKSCS "BIG5-HKSCS"
165 #define CS_TIS_620 "TIS-620"
166 #define CS_WINDOWS_874 "Windows-874"
167 #define CS_GEORGIAN_PS "GEORGIAN-PS"
168 #define CS_TCVN5712_1 "TCVN5712-1"
170 #define C_INTERNAL C_UTF_8
171 #define CS_INTERNAL CS_UTF_8
174 void conv_utf8todisp (gchar *outbuf, gint outlen, const gchar *inbuf);
175 void conv_localetodisp (gchar *outbuf, gint outlen, const gchar *inbuf);
177 CodeConverter *conv_code_converter_new (const gchar *src_charset);
178 void conv_code_converter_destroy (CodeConverter *conv);
179 gint conv_convert (CodeConverter *conv,
184 gchar *conv_codeset_strdup (const gchar *inbuf,
185 const gchar *src_code,
186 const gchar *dest_code);
188 const gchar *conv_get_charset_str (CharSet charset);
189 CharSet conv_get_charset_from_str (const gchar *charset);
190 const gchar *conv_get_locale_charset_str (void);
191 const gchar *conv_get_locale_charset_str_no_utf8(void);
192 const gchar *conv_get_outgoing_charset_str (void);
194 const gchar *conv_get_current_locale (void);
196 gchar *conv_unmime_header (const gchar *str,
197 const gchar *default_encoding);
198 void conv_encode_header (gchar *dest,
202 gboolean addr_field);
203 void conv_encode_header_full (gchar *dest,
208 const gchar *out_encoding_);
210 gchar *conv_filename_from_utf8 (const gchar *utf8_file);
211 gchar *conv_filename_to_utf8 (const gchar *fs_file);
212 void codeconv_set_strict (gboolean mode);
213 #endif /* __CODECONV_H__ */