Add Russian translation provided by Валерий Крувялис <valkru@mail.ru>
[xiph-mirror.git] / vorbis-tools / include / utf8.h
blobb225f515b3c3da9690a558d8171365fa9786389b
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 '?'.
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.
11 * Return value of conversion functions:
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 '?')
20 #ifndef __UTF8_H
21 #define __UTF8_H
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
27 void convert_set_charset(const char *charset);
29 int utf8_encode(const char *from, char **to);
30 int utf8_decode(const char *from, char **to);
31 int utf8_validate(const char *from);
33 #ifdef __cplusplus
35 #endif
37 #endif /* __UTF8_H */