Blame


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