Add support for the iso-8859-8-i encoding
[claws.git] / src / codeconv.h
index 86efe905a0f8e6ae09d2d1312b12d0a869fb82d1..9cf2596b8d68e284e8635e14b4fc4bd41d369d36 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2005 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail 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
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * 
  */
 
 #ifndef __CODECONV_H__
 #define __CODECONV_H__
 
 #ifdef HAVE_CONFIG_H
-#  include "config.h"
+#include "claws-features.h"
 #endif
 
 #include <glib.h>
@@ -69,6 +69,7 @@ typedef enum
        C_WINDOWS_1257,
        C_WINDOWS_1258,
        C_KOI8_R,
+       C_MACCYR,
        C_KOI8_T,
        C_KOI8_U,
        C_ISO_2022_JP,
@@ -81,6 +82,7 @@ typedef enum
        C_EUC_KR,
        C_ISO_2022_CN,
        C_EUC_CN,
+       C_GB18030,
        C_GB2312,
        C_GBK,
        C_EUC_TW,
@@ -92,7 +94,7 @@ typedef enum
        C_TCVN5712_1
 } CharSet;
 
-typedef void (*CodeConvFunc) (gchar *outbuf, gint outlen, const gchar *inbuf);
+typedef gint (*CodeConvFunc) (gchar *outbuf, gint outlen, const gchar *inbuf);
 
 struct _CodeConverter
 {
@@ -114,6 +116,7 @@ struct _CodeConverter
 #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_8_I        "ISO-8859-8-I"
 #define CS_ISO_8859_9          "ISO-8859-9"
 #define CS_ISO_8859_10         "ISO-8859-10"
 #define CS_ISO_8859_11         "ISO-8859-11"
@@ -140,6 +143,8 @@ struct _CodeConverter
 #define CS_WINDOWS_1257                "Windows-1257"
 #define CS_WINDOWS_1258                "Windows-1258"
 #define CS_KOI8_R              "KOI8-R"
+#define CS_X_MACCYR            "x-mac-cyrillic"
+#define CS_MACCYR              "Mac-Cyrillic"
 #define CS_KOI8_T              "KOI8-T"
 #define CS_KOI8_U              "KOI8-U"
 #define CS_ISO_2022_JP         "ISO-2022-JP"
@@ -156,6 +161,7 @@ struct _CodeConverter
 #define CS_EUC_KR              "EUC-KR"
 #define CS_ISO_2022_CN         "ISO-2022-CN"
 #define CS_EUC_CN              "EUC-CN"
+#define CS_GB18030             "GB18030"
 #define CS_GB2312              "GB2312"
 #define CS_GBK                 "GBK"
 #define CS_X_GBK               "X-GBK"
@@ -166,13 +172,11 @@ struct _CodeConverter
 #define CS_WINDOWS_874         "Windows-874"
 #define CS_GEORGIAN_PS         "GEORGIAN-PS"
 #define CS_TCVN5712_1          "TCVN5712-1"
+#define CS_X_VIET_VPS          "X-VIET-VPS"
 
 #define C_INTERNAL             C_UTF_8
 #define CS_INTERNAL            CS_UTF_8
 
-//void conv_mb_alnum(gchar *str);
-
-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);
@@ -188,30 +192,17 @@ 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);
-CharSet conv_get_internal_charset              (void);
-const gchar *conv_get_internal_charset_str     (void);
-CharSet conv_get_outgoing_charset              (void);
+const gchar *conv_get_locale_charset_str_no_utf8(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);
+                                         const gchar   *default_encoding,
+                                         gboolean       addr_field);
 void conv_encode_header                        (gchar          *dest,
                                         gint            len,
                                         const gchar    *src,
@@ -226,5 +217,5 @@ void conv_encode_header_full                (gchar          *dest,
 
 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__ */