Files
stable-diffusion.cpp/thirdparty/utf8proc

utf8proc source subset

This directory contains the utf8proc sources used by sd.cpp's JSON tokenizer for NFC normalization, lowercase mapping, and UTF-8 decoding and encoding.

Upstream source

The following four files were copied from the upstream repository root without local modifications. Their original filenames are preserved. This README is maintained by sd.cpp and replaces the upstream README.

File Purpose
utf8proc.c Library implementation; the only separately compiled C file.
utf8proc.h Public declarations, types and version definitions.
utf8proc_data.c Unicode data tables included by utf8proc.c.
LICENSE.md Library and Unicode data license notices.

The library implementation and Unicode tables are retained in full. utf8proc_data.c is copied as supplied by upstream; sd.cpp does not regenerate it or compile it as a separate translation unit. Upstream tests, benchmarks, documentation, data-generation tools and build/packaging files are omitted.

Build integration

The parent CMake file compiles utf8proc.c as the sd-utf8proc OBJECT target with UTF8PROC_STATIC and position-independent code enabled. The object is included directly in the sd.cpp static or shared library, with no separate utf8proc library required by consumers. The license is installed alongside sd.cpp.

All four upstream files belong under version control. Build artifacts belong in the build directory; this subset requires no generated configuration header.

When refreshing this subset, copy all four files from the same upstream revision and retain LICENSE.md. Update the release, commit and Unicode version recorded here. Recheck source dependencies and validate tokenizer normalization, lowercase conversion and token IDs on supported platforms.