Maul Unicode

Unicode algorithms and character properties in C, with no dependencies and no allocation.

CI License: MIT Release OpenSSF Scorecard

Every program that handles text has to answer the same questions. Is this valid UTF-8, and where does it go wrong? Where does one user-perceived character end, for the caret and for backspace? Where may a line break? In which order do mixed left-to-right and right-to-left runs appear? Which script is each part in, for shaping and fonts? Are two strings the same text in different forms, or do they only look alike?

Maul Unicode answers them for games, engines and applications:

Every answer comes from one Unicode version, 18.0.0, and every official conformance test passes completely. Iterators live on the caller's stack and results go into caller buffers, every function is safe from any thread, and results are identical on every platform. Normalization, case and confusable detection can be left out of a build with their tables.

Quick start

It builds with CMake 3.25 or newer and GCC 14 or newer, Clang 19 or newer, or Apple Clang. Ubuntu 24.04's default compiler is GCC 13, which the build refuses, so there install GCC 14, with Git and CMake, and tell CMake to use it:

sudo apt install git cmake gcc-14
export CC=gcc-14

Then, on Linux and macOS:

git clone https://github.com/Rawframe-Project/maul-unicode.git
cd maul-unicode
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
ctest --test-dir build
./build/sample_segments "Hello, world. 👋🏽 Next."

A build/ that GCC 13 already configured keeps that compiler and fails again ("GCC 14 or newer is required"). Remove it and configure again, with CC exported as above, then carry on with the rest of the block from cmake --build build:

rm -rf build && cmake -B build -DCMAKE_BUILD_TYPE=Release

Windows (clang-cl) and the web (Emscripten) are covered in Getting started.

Install it with cmake --install build --prefix <prefix> and use it from CMake:

find_package(maul-unicode REQUIRED CONFIG)
target_link_libraries(app PRIVATE maul-unicode::maul-unicode)

or through pkg-config as maul-unicode. Getting started covers the build options and the model the API follows.

Platforms

Linux with GCC 14 or Clang 19 and newer, macOS with Apple Clang, Windows with clang-cl, and WebAssembly with Emscripten; CI builds and tests each. The public headers are C17 and C++17, so any C or C++ program can include them.

Documentation

Maul Unicode belongs to the Maul family of standalone C libraries, which share one set of conventions.

Contributing

Issues are welcome. Pull requests are accepted for issues a maintainer has approved; see CONTRIBUTING.md. The project is developed with AI coding agents, directed and reviewed by its maintainers; outside contributions follow the AI policy.

License

MIT; see LICENSE. The Unicode data files in tools/ucd/ are covered by the Unicode License v3.