SofaBuffers C/C++ 0.12.0
API Documentation
Loading...
Searching...
No Matches
utf8.h File Reference

SofaBuffers C - Hand-written UTF-8 validator (SOFAB_STRICT_UTF8). More...

#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include "sofab/sofab.h"
Include dependency graph for utf8.h:

Go to the source code of this file.

Detailed Description

SofaBuffers C - Hand-written UTF-8 validator (SOFAB_STRICT_UTF8).

A string payload is UTF-8 (MESSAGE_SPEC §8); this module provides the validator the corelib uses to enforce that on the encode and decode paths when SOFAB_STRICT_UTF8 is enabled. This is a footprint corelib, so the check defaults OFF (CORELIB_PLAN §6.4's constrained-profile allowance); opt in with SOFAB_ENABLE_STRICT_UTF8 (or -DSOFAB_STRICT_UTF8=1). It is a security surface — a real validator, not a byte-range shortcut — and is declared (and compiled) only when the check is on, so the default build pays zero .text / .rodata cost (CORELIB_PLAN §6.4).

SPDX-License-Identifier: MIT

Definition in file utf8.h.