2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or (at
5 * your option) any later version.
7 * This program is distributed in the hope that it will be useful, but
8 * WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * Copyright © 2006 Pierre Habouzit
20 * Copyright notice from original mutt:
21 * Copyright (C) 1999-2000 Thomas Roessler <roessler@does-not-exist.org>
23 * This file is part of mutt-ng, see http://www.muttng.org/.
24 * It's licensed under the GNU General Public License,
25 * please see the file GPL in the top level source directory.
35 /****************************************************************************/
36 /* charset functions */
37 /****************************************************************************/
40 extern int Charset_is_utf8;
41 extern wchar_t CharsetReplacement;
43 void charset_initialize(void);
44 void charset_canonicalize(char *, ssize_t, const char *);
45 int charset_is_utf8(const char *s);
46 int charset_is_us_ascii(const char *s);
49 /****************************************************************************/
50 /* iconv-line functions */
51 /****************************************************************************/
57 my_iconv(iconv_t ict, const char **in, ssize_t *il, char **out, ssize_t *ol) {
58 return iconv(ict, (char **)in, (size_t*)il, out, (size_t*)ol);
62 # define iconv_t void*
63 # define iconv_open(a, b) ((iconv_t)(-1))
64 # define my_iconv(a,b,c,d,e) 0
65 # define iconv_close(a) 0
68 #define M_ICONV_HOOK_FROM 1
69 #define M_ICONV_HOOK_TO 2
71 int mutt_convert_string (char **, const char *, const char *, int);
72 const char *mutt_get_first_charset (const char *);
73 int mutt_convert_nonmime_string (char **);
75 iconv_t mutt_iconv_open (const char *, const char *, int);
76 ssize_t mutt_iconv (iconv_t, const char **, ssize_t *, char **, ssize_t *,
77 const char **, const char *);
80 /****************************************************************************/
81 /* fgetconv functions */
82 /****************************************************************************/
84 typedef void *FGETCONV;
86 FGETCONV *fgetconv_open (FILE *, const char *, const char *, int);
87 int fgetconv (FGETCONV *);
88 char *fgetconvs (char *, ssize_t, FGETCONV *);
89 void fgetconv_close (FGETCONV **);
91 #endif /* _CHARSET_H */