X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=doc%2Fusage.html;h=0a8c7e85c5ece5d1352d099348de28d8366d81f0;hb=3cea0be54e7466a949a91904e5e8e8858fc1ee50;hp=00bddefbfd66c45b1cc5413ff52315aab964ce9c;hpb=e2dc61467fd3fa3692d580ffe86f78965bb8485e;p=gedcom-parse.git diff --git a/doc/usage.html b/doc/usage.html index 00bddef..0a8c7e8 100644 --- a/doc/usage.html +++ b/doc/usage.html @@ -516,17 +516,29 @@ controls the gettext mechanism in the application.  

The source distribution of -gedcom-parse contains an example implementation (utf8-locale.c - and utf8-locale.h in the "t" subdirectory of the top directory).  - Feel free to use it in your source code (it is not part of the library, -and it isn't installed anywhere, so you need to take over the source and -header file in your application).  
+gedcom-parse contains an a library implementing help functions for UTF-8 encoding (see +the "utf8" subdirectory of the top directory).   Feel free to use + it in your source code.  It isn't installed anywhere, so you need +to take over the source and header files in your application. Note that on +some systems it uses libcharset, which is also included in this subdirectory. +  

- Its interface is:
+ Its interface contains first of all the following two help functions:
-
char *convert_utf8_to_locale (char *input, int *conv_failures);
char *convert_locale_to_utf8 (char *input);
+
int   is_utf8_string (char *input);
int utf8_strlen (char *input);
The +first one returns 1 if the given input is a valid UTF-8 string, it returns +0 otherwise, the second gives the number of UTF-8 characters in the given +input.  Note that the second function assumes that the input is valid +UTF-8, and gives unpredictable results if it isn't.
+
+For conversion, the following functions are available:
+
+
char *convert_utf8_to_locale (char *input, int *conv_failures);
char *convert_locale_to_utf8 (char *input);
+
+
+ Both functions return a pointer to a static buffer that is overwritten on each call.  To function properly, the application must first set the locale using the setlocale function (the second step detailed @@ -674,9 +686,9 @@ handle needs to be closed (when the program exits):
iconv_close(iconv_handle);
- - The example implementation - mentioned above grows the output buffer dynamically and outputs "?" for characters + + The example implementation +mentioned above grows the output buffer dynamically and outputs "?" for characters that can't be converted.
@@ -730,4 +742,5 @@ There are three preprocessor symbols defined for version checks in the


+
\ No newline at end of file