claws-mail/src/codeconv.h
Paul Mangan 4afa1432ff 2006-01-13 [paul] 1.9.100cvs142
* src/account.c
	* src/account.h
	* src/action.c
	* src/action.h
	* src/adbookbase.h
	* src/addr_compl.c
	* src/addr_compl.h
	* src/addrbook.c
	* src/addrcache.c
	* src/addrcache.h
	* src/addrcindex.c
	* src/addrcindex.h
	* src/addrclip.c
	* src/addrclip.h
	* src/addrdefs.h
	* src/addressadd.c
	* src/addressadd.h
	* src/addressbook.c
	* src/addressbook.h
	* src/addrgather.c
	* src/addrgather.h
	* src/addrharvest.c
	* src/addrharvest.h
	* src/addrindex.c
	* src/addrindex.h
	* src/addritem.c
	* src/addritem.h
	* src/addrquery.c
	* src/addrquery.h
	* src/addrselect.c
	* src/addrselect.h
	* src/alertpanel.c
	* src/alertpanel.h
	* src/browseldap.c
	* src/browseldap.h
	* src/codeconv.c
	* src/codeconv.h
	* src/compose.c
	* src/compose.h
	* src/customheader.c
	* src/customheader.h
	* src/displayheader.c
	* src/displayheader.h
	* src/editaddress.c
	* src/editaddress.h
	* src/editbook.c
	* src/editbook.h
	* src/editgroup.c
	* src/editgroup.h
	* src/editjpilot.c
	* src/editjpilot.h
	* src/editldap.c
	* src/editldap.h
	* src/editldap_basedn.c
	* src/editldap_basedn.h
	* src/editvcard.c
	* src/editvcard.h
	* src/exphtmldlg.c
	* src/exphtmldlg.h
	* src/expldifdlg.c
	* src/expldifdlg.h
	* src/export.h
	* src/exporthtml.c
	* src/exporthtml.h
	* src/exportldif.c
	* src/exportldif.h
	* src/filtering.c
	* src/filtering.h
	* src/folder.c
	* src/folder.h
	* src/folder_item_prefs.c
	* src/folder_item_prefs.h
	* src/foldersel.c
	* src/foldersel.h
	* src/folderutils.c
	* src/folderutils.h
	* src/folderview.c
	* src/folderview.h
	* src/grouplistdialog.c
	* src/grouplistdialog.h
	* src/headerview.c
	* src/html.c
	* src/html.h
	* src/image_viewer.c
	* src/image_viewer.h
	* src/imap.c
	* src/imap.h
	* src/imap_gtk.c
	* src/imap_gtk.h
	* src/import.h
	* src/importldif.c
	* src/importldif.h
	* src/importmutt.c
	* src/importmutt.h
	* src/importpine.c
	* src/importpine.h
	* src/inc.c
	* src/inc.h
	* src/jpilot.c
	* src/jpilot.h
	* src/ldapctrl.c
	* src/ldapctrl.h
	* src/ldaplocate.c
	* src/ldaplocate.h
	* src/ldapquery.c
	* src/ldapquery.h
	* src/ldapserver.c
	* src/ldapserver.h
	* src/ldaputil.c
	* src/ldaputil.h
	* src/ldif.c
	* src/ldif.h
	* src/main.c
	* src/main.h
	* src/mainwindow.c
	* src/mainwindow.h
	* src/manual.c
	* src/manual.h
	* src/mbox.c
	* src/mbox.h
	* src/message_search.c
	* src/message_search.h
	* src/messageview.c
	* src/messageview.h
	* src/mh.c
	* src/mh.h
	* src/mh_gtk.c
	* src/mh_gtk.h
	* src/mimeview.c
	* src/mimeview.h
	* src/msgcache.c
	* src/msgcache.h
	* src/mutt.c
	* src/mutt.h
	* src/news.c
	* src/news.h
	* src/news_gtk.c
	* src/news_gtk.h
	* src/partial_download.c
	* src/partial_download.h
	* src/pine.c
	* src/pine.h
	* src/pop.c
	* src/pop.h
	* src/prefs_account.c
	* src/prefs_account.h
	* src/prefs_actions.c
	* src/prefs_actions.h
	* src/prefs_common.c
	* src/prefs_common.h
	* src/prefs_compose_writing.c
	* src/prefs_compose_writing.h
	* src/prefs_customheader.c
	* src/prefs_customheader.h
	* src/prefs_display_header.c
	* src/prefs_display_header.h
	* src/prefs_filtering.c
	* src/prefs_filtering.h
	* src/prefs_filtering_action.c
	* src/prefs_filtering_action.h
	* src/prefs_folder_column.c
	* src/prefs_folder_column.h
	* src/prefs_folder_item.c
	* src/prefs_folder_item.h
	* src/prefs_fonts.c
	* src/prefs_fonts.h
	* src/prefs_gtk.c
	* src/prefs_gtk.h
	* src/prefs_image_viewer.c
	* src/prefs_image_viewer.h
	* src/prefs_matcher.c
	* src/prefs_matcher.h
	* src/prefs_message.c
	* src/prefs_msg_colors.c
	* src/prefs_msg_colors.h
	* src/prefs_other.c
	* src/prefs_quote.c
	* src/prefs_receive.c
	* src/prefs_send.c
	* src/prefs_spelling.c
	* src/prefs_spelling.h
	* src/prefs_summaries.c
	* src/prefs_summaries.h
	* src/prefs_summary_column.c
	* src/prefs_summary_column.h
	* src/prefs_template.c
	* src/prefs_template.h
	* src/prefs_themes.c
	* src/prefs_themes.h
	* src/prefs_toolbar.c
	* src/prefs_toolbar.h
	* src/prefs_wrapping.c
	* src/prefs_wrapping.h
	* src/privacy.c
	* src/privacy.h
	* src/procheader.c
	* src/procheader.h
	* src/procmime.c
	* src/procmime.h
	* src/procmsg.c
	* src/procmsg.h
	* src/quote_fmt.c
	* src/quote_fmt_parse.y
	* src/recv.c
	* src/recv.h
	* src/remotefolder.c
	* src/remotefolder.h
	* src/send_message.c
	* src/send_message.h
	* src/setup.c
	* src/setup.h
	* src/sourcewindow.c
	* src/sourcewindow.h
	* src/ssl_manager.c
	* src/ssl_manager.h
	* src/statusbar.c
	* src/statusbar.h
	* src/stock_pixmap.c
	* src/stock_pixmap.h
	* src/summary_search.c
	* src/summary_search.h
	* src/summaryview.c
	* src/summaryview.h
	* src/syldap.c
	* src/syldap.h
	* src/textview.c
	* src/textview.h
	* src/toolbar.c
	* src/toolbar.h
	* src/undo.c
	* src/undo.h
	* src/unmime.c
	* src/unmime.h
	* src/vcard.c
	* src/vcard.h
	* src/wizard.c
	* src/wizard.h
	* src/common/base64.c
	* src/common/base64.h
	* src/common/defs.h
	* src/common/hooks.c
	* src/common/hooks.h
	* src/common/log.c
	* src/common/log.h
	* src/common/mgutils.c
	* src/common/mgutils.h
	* src/common/nntp.c
	* src/common/nntp.h
	* src/common/passcrypt.c
	* src/common/passcrypt.h.in
	* src/common/plugin.c
	* src/common/plugin.h
	* src/common/prefs.c
	* src/common/prefs.h
	* src/common/progressindicator.c
	* src/common/progressindicator.h
	* src/common/quoted-printable.c
	* src/common/quoted-printable.h
	* src/common/session.c
	* src/common/session.h
	* src/common/smtp.c
	* src/common/smtp.h
	* src/common/socket.c
	* src/common/socket.h
	* src/common/ssl.c
	* src/common/ssl.h
	* src/common/ssl_certificate.c
	* src/common/ssl_certificate.h
	* src/common/stringtable.c
	* src/common/stringtable.h
	* src/common/sylpheed.c
	* src/common/sylpheed.h
	* src/common/template.c
	* src/common/template.h
	* src/common/timing.h
	* src/common/utils.c
	* src/common/utils.h
	* src/common/version.h.in
	* src/common/xml.c
	* src/common/xml.h
	* src/common/xmlprops.c
	* src/common/xmlprops.h
	* src/gtk/colorlabel.c
	* src/gtk/colorsel.c
	* src/gtk/colorsel.h
	* src/gtk/description_window.c
	* src/gtk/description_window.h
	* src/gtk/filesel.c
	* src/gtk/filesel.h
	* src/gtk/foldersort.c
	* src/gtk/foldersort.h
	* src/gtk/gtkutils.c
	* src/gtk/gtkutils.h
	* src/gtk/inputdialog.c
	* src/gtk/inputdialog.h
	* src/gtk/logwindow.c
	* src/gtk/logwindow.h
	* src/gtk/manage_window.c
	* src/gtk/manage_window.h
	* src/gtk/menu.c
	* src/gtk/menu.h
	* src/gtk/pluginwindow.c
	* src/gtk/pluginwindow.h
	* src/gtk/prefswindow.c
	* src/gtk/prefswindow.h
	* src/gtk/progressdialog.c
	* src/gtk/progressdialog.h
	* src/gtk/sslcertwindow.c
	* src/gtk/sslcertwindow.h
	* src/plugins/clamav/clamav_plugin.c
	* src/plugins/clamav/clamav_plugin.h
	* src/plugins/clamav/clamav_plugin_gtk.c
	* src/plugins/demo/demo.c
	* src/plugins/dillo_viewer/dillo_prefs.c
	* src/plugins/dillo_viewer/dillo_prefs.h
	* src/plugins/dillo_viewer/dillo_viewer.c
	* src/plugins/pgpcore/passphrase.c
	* src/plugins/pgpcore/passphrase.h
	* src/plugins/pgpcore/plugin.c
	* src/plugins/pgpcore/select-keys.c
	* src/plugins/pgpcore/select-keys.h
	* src/plugins/pgpcore/sgpgme.c
	* src/plugins/pgpcore/sgpgme.h
	* src/plugins/pgpinline/pgpinline.c
	* src/plugins/pgpinline/pgpinline.h
	* src/plugins/pgpinline/plugin.c
	* src/plugins/pgpmime/pgpmime.c
	* src/plugins/pgpmime/pgpmime.h
	* src/plugins/pgpmime/plugin.c
	* src/plugins/spamassassin/spamassassin.c
	* src/plugins/spamassassin/spamassassin.h
	* src/plugins/spamassassin/spamassassin_gtk.c
	* src/plugins/trayicon/trayicon.c
		update copyright header
2006-01-13 17:24:38 +00:00

230 lines
6.2 KiB
C

/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
* Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Sylpheed-Claws team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __CODECONV_H__
#define __CODECONV_H__
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <glib.h>
#include <iconv.h>
typedef struct _CodeConverter CodeConverter;
typedef enum
{
C_AUTO,
C_US_ASCII,
C_UTF_8,
C_UTF_7,
C_ISO_8859_1,
C_ISO_8859_2,
C_ISO_8859_3,
C_ISO_8859_4,
C_ISO_8859_5,
C_ISO_8859_6,
C_ISO_8859_7,
C_ISO_8859_8,
C_ISO_8859_9,
C_ISO_8859_10,
C_ISO_8859_11,
C_ISO_8859_13,
C_ISO_8859_14,
C_ISO_8859_15,
C_BALTIC,
C_CP1250,
C_CP1251,
C_CP1252,
C_CP1253,
C_CP1254,
C_CP1255,
C_CP1256,
C_CP1257,
C_CP1258,
C_WINDOWS_1250,
C_WINDOWS_1251,
C_WINDOWS_1252,
C_WINDOWS_1253,
C_WINDOWS_1254,
C_WINDOWS_1255,
C_WINDOWS_1256,
C_WINDOWS_1257,
C_WINDOWS_1258,
C_KOI8_R,
C_KOI8_T,
C_KOI8_U,
C_ISO_2022_JP,
C_ISO_2022_JP_2,
C_ISO_2022_JP_3,
C_EUC_JP,
C_EUC_JP_MS,
C_SHIFT_JIS,
C_ISO_2022_KR,
C_EUC_KR,
C_ISO_2022_CN,
C_EUC_CN,
C_GB2312,
C_GBK,
C_EUC_TW,
C_BIG5,
C_BIG5_HKSCS,
C_TIS_620,
C_WINDOWS_874,
C_GEORGIAN_PS,
C_TCVN5712_1
} CharSet;
typedef void (*CodeConvFunc) (gchar *outbuf, gint outlen, const gchar *inbuf);
struct _CodeConverter
{
CodeConvFunc code_conv_func;
gchar *charset_str;
CharSet charset;
};
#define CS_AUTO "AUTO"
#define CS_US_ASCII "US-ASCII"
#define CS_ANSI_X3_4_1968 "ANSI_X3.4-1968"
#define CS_UTF_8 "UTF-8"
#define CS_UTF_7 "UTF-7"
#define CS_ISO_8859_1 "ISO-8859-1"
#define CS_ISO_8859_2 "ISO-8859-2"
#define CS_ISO_8859_3 "ISO-8859-3"
#define CS_ISO_8859_4 "ISO-8859-4"
#define CS_ISO_8859_5 "ISO-8859-5"
#define CS_ISO_8859_6 "ISO-8859-6"
#define CS_ISO_8859_7 "ISO-8859-7"
#define CS_ISO_8859_8 "ISO-8859-8"
#define CS_ISO_8859_9 "ISO-8859-9"
#define CS_ISO_8859_10 "ISO-8859-10"
#define CS_ISO_8859_11 "ISO-8859-11"
#define CS_ISO_8859_13 "ISO-8859-13"
#define CS_ISO_8859_14 "ISO-8859-14"
#define CS_ISO_8859_15 "ISO-8859-15"
#define CS_BALTIC "BALTIC"
#define CS_CP1250 "CP1250"
#define CS_CP1251 "CP1251"
#define CS_CP1252 "CP1252"
#define CS_CP1253 "CP1253"
#define CS_CP1254 "CP1254"
#define CS_CP1255 "CP1255"
#define CS_CP1256 "CP1256"
#define CS_CP1257 "CP1257"
#define CS_CP1258 "CP1258"
#define CS_WINDOWS_1250 "Windows-1250"
#define CS_WINDOWS_1251 "Windows-1251"
#define CS_WINDOWS_1252 "Windows-1252"
#define CS_WINDOWS_1253 "Windows-1253"
#define CS_WINDOWS_1254 "Windows-1254"
#define CS_WINDOWS_1255 "Windows-1255"
#define CS_WINDOWS_1256 "Windows-1256"
#define CS_WINDOWS_1257 "Windows-1257"
#define CS_WINDOWS_1258 "Windows-1258"
#define CS_KOI8_R "KOI8-R"
#define CS_KOI8_T "KOI8-T"
#define CS_KOI8_U "KOI8-U"
#define CS_ISO_2022_JP "ISO-2022-JP"
#define CS_ISO_2022_JP_2 "ISO-2022-JP-2"
#define CS_ISO_2022_JP_3 "ISO-2022-JP-3"
#define CS_EUC_JP "EUC-JP"
#define CS_EUCJP "EUCJP"
#define CS_EUC_JP_MS "EUC-JP-MS"
#define CS_SHIFT_JIS "Shift_JIS"
#define CS_SHIFT__JIS "SHIFT-JIS"
#define CS_SJIS "SJIS"
#define CS_X_SJIS "X-SJIS"
#define CS_ISO_2022_KR "ISO-2022-KR"
#define CS_EUC_KR "EUC-KR"
#define CS_ISO_2022_CN "ISO-2022-CN"
#define CS_EUC_CN "EUC-CN"
#define CS_GB2312 "GB2312"
#define CS_GBK "GBK"
#define CS_X_GBK "X-GBK"
#define CS_EUC_TW "EUC-TW"
#define CS_BIG5 "Big5"
#define CS_BIG5_HKSCS "BIG5-HKSCS"
#define CS_TIS_620 "TIS-620"
#define CS_WINDOWS_874 "Windows-874"
#define CS_GEORGIAN_PS "GEORGIAN-PS"
#define CS_TCVN5712_1 "TCVN5712-1"
#define C_INTERNAL C_UTF_8
#define CS_INTERNAL CS_UTF_8
CharSet conv_guess_ja_encoding(const gchar *str);
void conv_utf8todisp (gchar *outbuf, gint outlen, const gchar *inbuf);
void conv_localetodisp (gchar *outbuf, gint outlen, const gchar *inbuf);
CodeConverter *conv_code_converter_new (const gchar *src_charset);
void conv_code_converter_destroy (CodeConverter *conv);
gint conv_convert (CodeConverter *conv,
gchar *outbuf,
gint outlen,
const gchar *inbuf);
gchar *conv_codeset_strdup (const gchar *inbuf,
const gchar *src_code,
const gchar *dest_code);
CodeConvFunc conv_get_code_conv_func (const gchar *src_charset_str,
const gchar *dest_charset_str);
gchar *conv_iconv_strdup (const gchar *inbuf,
const gchar *src_code,
const gchar *dest_code);
gchar *conv_iconv_strdup_with_cd (const gchar *inbuf,
iconv_t cd);
const gchar *conv_get_charset_str (CharSet charset);
CharSet conv_get_charset_from_str (const gchar *charset);
CharSet conv_get_locale_charset (void);
const gchar *conv_get_locale_charset_str (void);
const gchar *conv_get_locale_charset_str_no_utf8(void);
CharSet conv_get_internal_charset (void);
const gchar *conv_get_internal_charset_str (void);
CharSet conv_get_outgoing_charset (void);
const gchar *conv_get_outgoing_charset_str (void);
gboolean conv_is_multibyte_encoding (CharSet encoding);
const gchar *conv_get_current_locale (void);
gboolean conv_is_ja_locale (void);
gchar *conv_unmime_header (const gchar *str,
const gchar *default_encoding);
void conv_encode_header (gchar *dest,
gint len,
const gchar *src,
gint header_len,
gboolean addr_field);
void conv_encode_header_full (gchar *dest,
gint len,
const gchar *src,
gint header_len,
gboolean addr_field,
const gchar *out_encoding_);
gchar *conv_filename_from_utf8 (const gchar *utf8_file);
gchar *conv_filename_to_utf8 (const gchar *fs_file);
void codeconv_set_strict (gboolean mode);
#endif /* __CODECONV_H__ */