2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2001 Hiroyuki Yamamoto
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 2 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, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef __CODECONV_H__
21 #define __CODECONV_H__
33 typedef struct _CodeConverter CodeConverter;
70 typedef void (*CodeConvFunc) (gchar *outbuf, gint outlen, const gchar *inbuf);
75 CodeConvFunc code_conv_func;
81 #define CS_AUTO "AUTO"
82 #define CS_US_ASCII "US-ASCII"
83 #define CS_ANSI_X3_4_1968 "ANSI_X3.4-1968"
84 #define CS_UTF_8 "UTF-8"
85 #define CS_ISO_8859_1 "ISO-8859-1"
86 #define CS_ISO_8859_2 "ISO-8859-2"
87 #define CS_ISO_8859_4 "ISO-8859-4"
88 #define CS_ISO_8859_5 "ISO-8859-5"
89 #define CS_ISO_8859_7 "ISO-8859-7"
90 #define CS_ISO_8859_8 "ISO-8859-8"
91 #define CS_ISO_8859_9 "ISO-8859-9"
92 #define CS_ISO_8859_11 "ISO-8859-11"
93 #define CS_ISO_8859_13 "ISO-8859-13"
94 #define CS_ISO_8859_15 "ISO-8859-15"
95 #define CS_BALTIC "BALTIC"
96 #define CS_CP1251 "CP1251"
97 #define CS_WINDOWS_1251 "Windows-1251"
98 #define CS_KOI8_R "KOI8-R"
99 #define CS_KOI8_U "KOI8-U"
100 #define CS_ISO_2022_JP "ISO-2022-JP"
101 #define CS_ISO_2022_JP_2 "ISO-2022-JP-2"
102 #define CS_EUC_JP "EUC-JP"
103 #define CS_EUCJP "EUCJP"
104 #define CS_SHIFT_JIS "Shift_JIS"
105 #define CS_ISO_2022_KR "ISO-2022-KR"
106 #define CS_EUC_KR "EUC-KR"
107 #define CS_ISO_2022_CN "ISO-2022-CN"
108 #define CS_EUC_CN "EUC-CN"
109 #define CS_GB2312 "GB2312"
110 #define CS_EUC_TW "EUC-TW"
111 #define CS_BIG5 "Big5"
112 #define CS_TIS_620 "TIS-620"
113 #define CS_WINDOWS_874 "Windows-874"
115 void conv_jistoeuc(gchar *outbuf, gint outlen, const gchar *inbuf);
116 void conv_euctojis(gchar *outbuf, gint outlen, const gchar *inbuf);
117 void conv_sjistoeuc(gchar *outbuf, gint outlen, const gchar *inbuf);
118 void conv_anytoeuc(gchar *outbuf, gint outlen, const gchar *inbuf);
119 void conv_anytojis(gchar *outbuf, gint outlen, const gchar *inbuf);
120 void conv_unreadable_eucjp(gchar *str);
121 void conv_unreadable_8bit(gchar *str);
122 void conv_unreadable_latin(gchar *str);
123 void conv_mb_alnum(gchar *str);
125 void conv_jistodisp (gchar *outbuf, gint outlen, const gchar *inbuf);
126 void conv_sjistodisp (gchar *outbuf, gint outlen, const gchar *inbuf);
127 void conv_euctodisp (gchar *outbuf, gint outlen, const gchar *inbuf);
128 void conv_ustodisp (gchar *outbuf, gint outlen, const gchar *inbuf);
129 void conv_latintodisp(gchar *outbuf, gint outlen, const gchar *inbuf);
130 void conv_noconv (gchar *outbuf, gint outlen, const gchar *inbuf);
132 CodeConverter *conv_code_converter_new (const gchar *charset);
133 void conv_code_converter_destroy (CodeConverter *conv);
134 gint conv_convert (CodeConverter *conv,
139 gchar *conv_codeset_strdup(const gchar *inbuf,
140 const gchar *src_codeset,
141 const gchar *dest_codeset);
143 CodeConvFunc conv_get_code_conv_func(const gchar *charset);
145 const gchar *conv_get_charset_str (CharSet charset);
146 CharSet conv_get_charset_from_str (const gchar *charset);
147 CharSet conv_get_current_charset (void);
148 const gchar *conv_get_current_charset_str (void);
149 CharSet conv_get_outgoing_charset (void);
150 const gchar *conv_get_outgoing_charset_str (void);
152 const gchar *conv_get_current_locale (void);
154 void conv_unmime_header_overwrite (gchar *str);
155 void conv_unmime_header (gchar *outbuf,
158 const gchar *charset);
159 void conv_encode_header (gchar *dest,
165 #endif /* __CODECONV_H__ */