libgrapheme

unicode string library
git clone git://git.suckless.org/libgrapheme
Log | Files | Refs | README | LICENSE

README (2079B)


      1 libgrapheme
      2 ===========
      3 
      4 libgrapheme is an extremely simple freestanding C99 library providing
      5 utilities for properly handling strings according to the latest Unicode
      6 standard 15.0.0. It offers fully Unicode compliant
      7 
      8  - grapheme cluster (i.e. user-perceived character) segmentation
      9  - word segmentation
     10  - sentence segmentation
     11  - detection of permissible line break opportunities
     12  - case detection (lower-, upper- and title-case)
     13  - case conversion (to lower-, upper- and title-case)
     14 
     15 on UTF-8 strings and codepoint arrays, which both can also be
     16 null-terminated.
     17 
     18 The necessary lookup-tables are automatically generated from the Unicode
     19 standard data (contained in the tarball) and heavily compressed. Over
     20 10,000 automatically generated conformance tests and over 150 unit tests
     21 ensure conformance and correctness.
     22 
     23 There is no complicated build-system involved and it's all done using one
     24 POSIX-compliant Makefile. All you need is a C99 compiler, given the
     25 lookup-table-generators and compressors are also written in C99. The
     26 resulting library is freestanding and thus not even dependent on a
     27 standard library to be present at runtime, making it a suitable choice
     28 for bare metal applications.
     29 
     30 It is also way smaller and much faster than the other established
     31 Unicode string libraries (ICU, GNU's libunistring, libutf8proc).
     32 
     33 Requirements
     34 ------------
     35 A C99-compiler and POSIX make.
     36 
     37 Installation
     38 ------------
     39 Run ./configure, which automatically edits config.mk to match your local
     40 setup. Edit config.mk by hand if necessary or desired for further
     41 customization.
     42 
     43 Afterwards enter the following command to build and install libgrapheme
     44 (if necessary as root):
     45 
     46 	make install
     47 
     48 Conformance
     49 -----------
     50 The libgrapheme library is compliant with the Unicode 15.0.0
     51 specification (September 2022). The tests can be run with
     52 
     53 	make test
     54 
     55 to check standard conformance and correctness.
     56 
     57 Usage
     58 -----
     59 Include the header grapheme.h in your code and link against libgrapheme
     60 with "-lgrapheme" either statically ("-static") or dynamically.
     61 
     62 Author
     63 ------
     64 Laslo Hunhold <dev@frign.de>