*** empty log message ***
[libidn.git] / README
blob3b08610d4b9bcd3575743c8c9d4a94f309f25346
1 Libstringprep README -- important introductory notes
2 See the end for copying conditions.
4 Libstringprep is an implementation of the IETF stringprep
5 specification, licensed under the LGPL.
7 Libstringprep is unstable and in its early steps of development.  You
8 should expect it to not work as well as having security problems.
10 Currently the API include the following definitions and functions:
12 Header file: #include <stringprep.h>
14      Main API header file.
16 Header file: #include <stringprep_nameprep.h>
17 Header file: #include <stringprep_kerbero5.h>
19      Convenience header files for stringprep_nameprep* and
20      stringprep_kerberos5 macros (see below).
22 Function: int stringprep (char *in, int maxlen, int flags,
23                           Stringprep_profile * profile);
25      Perform stringprep on a zero terminated UTF-8 string.  Since the
26      stringprep operation can expand the string, maxlen indicate how
27      large the buffer holding the string is.  See below for valid
28      flags options.  The profile indicates processing details, see the
29      profile header files, such as stringprep_generic.h and
30      stringprep_nameprep.h for two examples.  Your application can
31      define new profiles, possibly re-using the generic stringprep
32      tables that always will be part of the library.  Note that you
33      must convert strings entered in the systems locale into UTF-8
34      before using this function.
36 Macro: int stringprep_nameprep(char *in, int maxlen)
37 Macro: int stringprep_nameprep_no_unassigned(char *in, int maxlen)
38 Macro: int stringprep_kerberos5(char *in, int maxlen)
40      Short-hand macros for applying Nameprep with
41      AllowUnassigned=TRUE, Nameprep with AllowUnassigned=FALSE and
42      Kerberos 5 stringprep profiles to strings, respectively.
44 Macro: STRINGPREP_VERSION
46      CPP definition, a string with version of the stringprep header file.
48 Function: extern char *stringprep_check_version (char *req_version);
50      Check that the the version of the library is at minimum the one
51      given as a string in REQ_VERSION and return the actual version
52      string of the library; return NULL if the condition is not met.
53      If `NULL' is passed to this function no check is done and only the
54      version string is returned.
56 Type: STRINGPREP_NO_NFKC
57 Type: STRINGPREP_NO_BIDI
58 Type: STRINGPREP_NO_UNASSIGNED
60      Valid options to the FLAGS parameter of stringprep().
61      STRINGPREP_NO_NFKC disables the NFKC normalization, as well as
62      selecting the non-NFKC case folding tables. STRINGPREP_NO_BIDI
63      disables the BIDI step.  STRINGPREP_NO_UNASSIGNED causes
64      stringprep() abort with an error if string contains unassigned
65      characters according to profile.  Usually the profile specifies
66      BIDI and NFKC settings.
68 The library also contains the following utility functions:
70 Function: int stringprep_unichar_to_utf8 (long c, char *outbuf);
71 Function: long stringprep_utf8_to_unichar (const char *p);
73      Convert between Unicode (UCS4) and UTF-8, one character only.
75 Function: long *stringprep_utf8_to_ucs4 (const char *str, int  len,
76                                       int *items_written);
77 Function: char *stringprep_ucs4_to_utf8 (const long * str, int len,
78                                       int * items_read, int * items_written);
80      Convert between Unicode (UCS4) and UTF-8, zero-terminated strings.
82 Function: char *stringprep_utf8_nfkc_normalize (const char *str, int len);
83 Function: long *stringprep_ucs4_nfkc_normalize (long *str, int len);
85      Perform NFKC normalization on strings.
87 Function: const char *stringprep_locale_charset ();
88 Function: char *stringprep_convert (const char *str,
89                                  const char *to_codeset,
90                                  const char *from_codeset);
91 Function: char *stringprep_locale_to_utf8 (const char *str);
93      Convert strings between character sets.
95 Libstringprep has at some point in time passed the self tests on the
96 following systems, but no guarantees.
98   - alphaev67-dec-osf5.0 (Tru64 UNIX C, Tru64 make -- iconv failed!)
99   - i686-pc-linux-gnu (Debian Sid, iconv ok)
100   - i686-pc-linux-gnu (RedHat 7.2, iconv ok)
101   - mips-sgi-irix6.5 (MIPS C compiler, IRIX make, iconv ok)
102   - rs6000-ibm-aix4.3.2.0 (GCC 2.9-aix43-000718, GNU make, iconv failed!)
103   - rs6000-ibm-aix4.3.2.0 (IBM C for AIX compiler, AIX make, iconv failed!)
104   - sparc-sun-solaris2.6 (Sun WorkShop Compiler C 5.0, non-GNU make)
105   - sparc-sun-solaris2.8 (Sun WorkShop Compiler C 6.0U2, SUN make, iconv ok)
106   - sparc-sun-solaris2.8 (GCC 3.1, GNU make, iconv ok)
107   - ... and over 10 other unix systems.
109 Things left to do below.  If you like to start working on anything,
110 please let me know so work duplication can be avoided.
112   - Optimize it, the table searching is slow (but does it matter?).
113   - Port applications to use libstringprep.
114   - Include tables for more stringprep profiles.
115   - Add texi documentation.
116   - Implement rest of IDN?  Possibly separate project.
118 Before it becomes a FAQ: This library do not link with GLIB for the
119 UTF-8 functions for two reasons.  First, GLIB does not provide
120 versioning of the Unicode tables (and the developers said it will not
121 be added either) and this package must know the Unicode version used.
122 Secondly, GLIB requires some things (e.g., threads) that would make
123 this package less portable.
125 For more information see <URL:http://josefsson.org/libstringprep/>.
127 Send all bug reports by electronic mail to bug-libstringprep@josefsson.org.
129 ----------------------------------------------------------------------
130 Copyright (C) 2002 Simon Josefsson
132 Copying and distribution of this file, with or without modification,
133 are permitted in any medium without royalty provided the copyright
134 notice and this notice are preserved.