File: utf8.h

package info (click to toggle)
flac 1.4.2%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,140 kB
  • sloc: ansic: 49,398; cpp: 9,983; sh: 6,438; makefile: 851; perl: 162
file content (25 lines) | stat: -rw-r--r-- 816 bytes parent folder | download | duplicates (25)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef SHARE__UTF8_H
#define SHARE__UTF8_H

/*
 * Convert a string between UTF-8 and the locale's charset.
 * Invalid bytes are replaced by '#', and characters that are
 * not available in the target encoding are replaced by '?'.
 *
 * If the locale's charset is not set explicitly then it is
 * obtained using nl_langinfo(CODESET), where available, the
 * environment variable CHARSET, or assumed to be US-ASCII.
 *
 * Return value of conversion functions:
 *
 *  -1 : memory allocation failed
 *   0 : data was converted exactly
 *   1 : valid data was converted approximately (using '?')
 *   2 : input was invalid (but still converted, using '#')
 *   3 : unknown encoding (but still converted, using '?')
 */

int utf8_encode(const char *from, char **to);
int utf8_decode(const char *from, char **to);

#endif