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