X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=utf8%2Futf8.h;fp=utf8%2Futf8-locale.h;h=79836dd6d4aa265307fbcd143de342e46ca6c8e4;hb=b254663a41a4da7bc4c9039f89411f4b3bd0b8a7;hp=b8a752b621cbcfd18afebcafd1cb46cc3b2a92d6;hpb=eb3312e2460a43abb5936cd35f29d17001367d3b;p=gedcom-parse.git diff --git a/utf8/utf8-locale.h b/utf8/utf8.h similarity index 58% rename from utf8/utf8-locale.h rename to utf8/utf8.h index b8a752b..79836dd 100644 --- a/utf8/utf8-locale.h +++ b/utf8/utf8.h @@ -1,4 +1,4 @@ -/* Encoding utility from UTF-8 to locale and vice versa +/* Header file for UTF-8 functions Copyright (C) 2001, 2002 Peter Verthez Permission granted to do anything with this file that you want, as long @@ -9,13 +9,20 @@ /* $Id$ */ /* $Name$ */ -#ifndef __UTF8_LOCALE_H -#define __UTF8_LOCALE_H +#ifndef __UTF8_H +#define __UTF8_H #ifdef __cplusplus extern "C" { #endif + /* Returns -1 if the string is not a valid UTF-8 string, returns its + string length otherwise */ +int utf8_strlen(const char* input); + + /* Returns 1 if string is valid UTF-8 string, 0 otherwise */ +int is_utf8_string(const char* input); + void convert_set_unknown(const char* unknown); char* convert_utf8_to_locale(const char* input, int *conv_fails); char* convert_locale_to_utf8(const char* input); @@ -24,4 +31,4 @@ char* convert_locale_to_utf8(const char* input); } #endif -#endif /* __UTF8_LOCALE_H */ +#endif /* __UTF8_H */