Added utf8.c
[gedcom-parse.git] / utf8 / utf8.h
1 /* Header file for UTF-8 functions
2    Copyright (C) 2001, 2002 Peter Verthez
3
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
7 */
8
9 /* $Id$ */
10 /* $Name$ */
11
12 #ifndef __UTF8_H
13 #define __UTF8_H
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19   /* Returns -1 if the string is not a valid UTF-8 string, returns its
20      string length otherwise */
21 int   utf8_strlen(const char* input);
22
23   /* Returns 1 if string is valid UTF-8 string, 0 otherwise */
24 int   is_utf8_string(const char* input);
25   
26 void  convert_set_unknown(const char* unknown);
27 char* convert_utf8_to_locale(const char* input, int *conv_fails);
28 char* convert_locale_to_utf8(const char* input);
29
30 #ifdef __cplusplus
31 }
32 #endif
33
34 #endif /* __UTF8_H */