5 * Convert a string between UTF-8 and the locale's charset.
6 * Invalid bytes are replaced by '#', and characters that are
7 * not available in the target encoding are replaced by '?'.
9 * If the locale's charset is not set explicitly then it is
10 * obtained using nl_langinfo(CODESET), where available, the
11 * environment variable CHARSET, or assumed to be US-ASCII.
13 * Return value of conversion functions:
15 * -1 : memory allocation failed
16 * 0 : data was converted exactly
17 * 1 : valid data was converted approximately (using '?')
18 * 2 : input was invalid (but still converted, using '#')
19 * 3 : unknown encoding (but still converted, using '?')
22 int utf8_encode(const char *from
, char **to
);
23 int utf8_decode(const char *from
, char **to
);