const char *charset_from_utf8(const char *from) { static char *to = NULL; if (to) free(to); charset_set("ISO−8859−1", "UTF-8"); to = charset_conv_strdup(from); if (to == NULL) return from; return to; }
const char * charset_from_utf8(const char *from) { static char * to = NULL; if (!charset_enable_output) /* no locale: return raw UTF-8 */ return from; if(to) free(to); charset_set(locale_charset, "UTF-8"); to = charset_conv_strdup(from); if (to == NULL) return from; return to; }
const char * charset_to_utf8(const char *from) { static char * to = NULL; if (!charset_enable_input) /* no locale: return raw input */ return from; if(to) free(to); charset_set("UTF-8", locale_charset); to = charset_conv_strdup(from); if (to == NULL) return from; return to; }