1 /* Header file for UTF-8 functions
2 Copyright (C) 2001, 2002 Peter Verthez
4 Permission granted to do anything with this file that you want, as long
5 as the above copyright is retained in all copies.
6 THERE IS NO WARRANTY - USE AT YOUR OWN RISK
29 struct conv_buffer* outbuf;
33 typedef struct convert *convert_t;
35 /* Returns -1 if the string is not a valid UTF-8 string, returns its
36 string length otherwise */
37 int utf8_strlen(const char* input);
39 /* Returns 1 if string is valid UTF-8 string, 0 otherwise */
40 int is_utf8_string(const char* input);
42 /* General conversion interface (is bidirectional) */
43 convert_t initialize_utf8_conversion(const char* charset);
44 int conversion_set_unknown(convert_t conv, const char* unknown);
45 void cleanup_utf8_conversion(convert_t conv);
46 char* convert_from_utf8(convert_t conv, const char* input, int* conv_fails);
47 char* convert_to_utf8(convert_t conv, const char* input);
49 /* Specific locale conversion interface */
50 void convert_set_unknown(const char* unknown);
51 char* convert_utf8_to_locale(const char* input, int *conv_fails);
52 char* convert_locale_to_utf8(const char* input);