51 # define HAVE_LOCALE_H 1
52 # define HAVE_LANGINFO_CODESET 1
57 #ifdef HAVE_LANGINFO_CODESET
58 # include <langinfo.h>
62 # define stringprep_locale_charset() nl_langinfo (CODESET)
87 const char *charset = getenv (
"CHARSET");
89 if (charset && *charset)
92 # ifdef HAVE_LANGINFO_CODESET
93 charset = nl_langinfo (CODESET);
95 if (charset && *charset)
117 const char *to_codeset,
const char *from_codeset)
120 return str_iconv (str, from_codeset, to_codeset);
125 fprintf (stderr,
"libidn: warning: libiconv not installed, cannot "
126 "convert data to UTF-8\n");
127 p = malloc (strlen (str) + 1);
130 return strcpy (p, str);
char * stringprep_locale_to_utf8(const char *str)
char * stringprep_convert(const char *str, const char *to_codeset, const char *from_codeset)
char * stringprep_utf8_to_locale(const char *str)
const char * stringprep_locale_charset(void)