chiark / gitweb /
gpg agent lockup fix: Interrupt main loop when active_connections_value==0
[gnupg2.git] / common / utf8conv.h
1 /* utf8conf.h
2  *      Copyright (C) 2003, 2006 Free Software Foundation, Inc.
3  *
4  * This file is part of GnuPG.
5  *
6  * GnuPG is free software; you can redistribute it and/or modify it
7  * under the terms of either
8  *
9  *   - the GNU Lesser General Public License as published by the Free
10  *     Software Foundation; either version 3 of the License, or (at
11  *     your option) any later version.
12  *
13  * or
14  *
15  *   - the GNU General Public License as published by the Free
16  *     Software Foundation; either version 2 of the License, or (at
17  *     your option) any later version.
18  *
19  * or both in parallel, as here.
20  *
21  * GnuPG is distributed in the hope that it will be useful, but
22  * WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
24  * General Public License for more details.
25  *
26  * You should have received a copies of the GNU General Public License
27  * and the GNU Lesser General Public License along with this program;
28  * if not, see <https://www.gnu.org/licenses/>.
29  */
30
31 #ifndef GNUPG_COMMON_UTF8CONF_H
32 #define GNUPG_COMMON_UTF8CONF_H
33
34 int set_native_charset (const char *newset);
35 const char *get_native_charset (void);
36 int is_native_utf8 (void);
37
38 char *native_to_utf8 (const char *string);
39 char *utf8_to_native (const char *string, size_t length, int delim);
40
41
42 /* Silly wrappers, required for W32 portability.  */
43 typedef void *jnlib_iconv_t;
44
45 jnlib_iconv_t jnlib_iconv_open (const char *tocode, const char *fromcode);
46 size_t jnlib_iconv (jnlib_iconv_t cd, const char **inbuf, size_t *inbytesleft,
47                     char **outbuf, size_t *outbytesleft);
48 int jnlib_iconv_close (jnlib_iconv_t cd);
49
50 #ifdef HAVE_W32_SYSTEM
51 char *wchar_to_native (const wchar_t *string);
52 wchar_t *native_to_wchar (const char *string);
53 char *wchar_to_utf8 (const wchar_t *string);
54 wchar_t *utf8_to_wchar (const char *string);
55 #endif /*HAVE_W32_SYSTEM*/
56
57
58 #endif /*GNUPG_COMMON_UTF8CONF_H*/