make names more consistent
[platform/upstream/flac.git] / include / share / utf8.h
1 #ifndef SHARE__UTF8_H
2 #define SHARE__UTF8_H
3
4 #if defined(FLAC__NO_DLL) || defined(unix) || defined(__CYGWIN__) || defined(__CYGWIN32__)
5 #define UTF8_API
6
7 #else
8
9 #ifdef UTF8_API_EXPORTS
10 #define UTF8_API        _declspec(dllexport)
11 #else
12 #define UTF8_API        _declspec(dllimport)
13 #define __LIBNAME__ "utf8.lib"
14 #pragma comment(lib, __LIBNAME__)
15 #undef __LIBNAME__
16
17 #endif
18 #endif
19
20
21 /*
22  * Convert a string between UTF-8 and the locale's charset.
23  * Invalid bytes are replaced by '#', and characters that are
24  * not available in the target encoding are replaced by '?'.
25  *
26  * If the locale's charset is not set explicitly then it is
27  * obtained using nl_langinfo(CODESET), where available, the
28  * environment variable CHARSET, or assumed to be US-ASCII.
29  *
30  * Return value of conversion functions:
31  *
32  *  -1 : memory allocation failed
33  *   0 : data was converted exactly
34  *   1 : valid data was converted approximately (using '?')
35  *   2 : input was invalid (but still converted, using '#')
36  *   3 : unknown encoding (but still converted, using '?')
37  */
38
39 UTF8_API void convert_set_charset(const char *charset);
40
41 UTF8_API int utf8_encode(const char *from, char **to);
42 UTF8_API int utf8_decode(const char *from, char **to);
43
44 #endif