sync with 0.8.8cvs5
[claws.git] / src / codeconv.h
index 518697707fd6a9177c71f6f9e52811c9cca03388..892b198d2f40aab5867aa2284245c9e73897c114 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2003 Hiroyuki Yamamoto
  *
  * 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
 
 #include <glib.h>
 
-#if HAVE_LIBJCONV
-#  include <jconv.h>
-#endif
-
 typedef struct _CodeConverter  CodeConverter;
 
 typedef enum
@@ -44,6 +40,7 @@ typedef enum
        C_ISO_8859_7,
        C_ISO_8859_8,
        C_ISO_8859_9,
+       C_ISO_8859_11,
        C_ISO_8859_13,
        C_ISO_8859_15,
        C_BALTIC,
@@ -61,16 +58,16 @@ typedef enum
        C_EUC_CN,
        C_GB2312,
        C_EUC_TW,
-       C_BIG5
+       C_BIG5,
+       C_TIS_620,
+       C_WINDOWS_874
 } CharSet;
 
 typedef void (*CodeConvFunc) (gchar *outbuf, gint outlen, const gchar *inbuf);
 
 struct _CodeConverter
 {
-#if !HAVE_LIBJCONV
        CodeConvFunc code_conv_func;
-#endif
        gchar *charset_str;
        CharSet charset;
 };
@@ -86,6 +83,7 @@ struct _CodeConverter
 #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_11         "ISO-8859-11"
 #define CS_ISO_8859_13         "ISO-8859-13"
 #define CS_ISO_8859_15         "ISO-8859-15"
 #define CS_BALTIC              "BALTIC"
@@ -98,6 +96,9 @@ struct _CodeConverter
 #define CS_EUC_JP              "EUC-JP"
 #define CS_EUCJP               "EUCJP"
 #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"
@@ -105,6 +106,8 @@ struct _CodeConverter
 #define CS_GB2312              "GB2312"
 #define CS_EUC_TW              "EUC-TW"
 #define CS_BIG5                        "Big5"
+#define CS_TIS_620             "TIS-620"
+#define CS_WINDOWS_874         "Windows-874"
 
 void conv_jistoeuc(gchar *outbuf, gint outlen, const gchar *inbuf);
 void conv_euctojis(gchar *outbuf, gint outlen, const gchar *inbuf);
@@ -116,6 +119,8 @@ void conv_unreadable_8bit(gchar *str);
 void conv_unreadable_latin(gchar *str);
 void conv_mb_alnum(gchar *str);
 
+CharSet conv_guess_encoding(const gchar *str);
+
 void conv_jistodisp  (gchar *outbuf, gint outlen, const gchar *inbuf);
 void conv_sjistodisp (gchar *outbuf, gint outlen, const gchar *inbuf);
 void conv_euctodisp  (gchar *outbuf, gint outlen, const gchar *inbuf);
@@ -130,11 +135,18 @@ gint conv_convert                 (CodeConverter  *conv,
                                         gint            outlen,
                                         const gchar    *inbuf);
 
-gchar *conv_codeset_strdup(const gchar *inbuf,
-                          const gchar *src_codeset,
-                          const gchar *dest_codeset);
+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);
 
-CodeConvFunc conv_get_code_conv_func(const gchar *charset);
+#if HAVE_ICONV
+gchar *conv_iconv_strdup               (const gchar    *inbuf,
+                                        const gchar    *src_code,
+                                        const gchar    *dest_code);
+#endif
 
 const gchar *conv_get_charset_str              (CharSet         charset);
 CharSet conv_get_charset_from_str              (const gchar    *charset);