This is a single file library for making working with strings in C a bit easier.
Main features:
- A suite of UTF-8, UTF-16 and UTF-32 conversion routines.
- An API for dynamic strings (
c89str
). - Alternatives to some standard library functions.
- A suite of miscellaneous APIs that might be useful.
- An implementation of sprintf().
The APIs in this library are focused on flexibility and will favor verbosity over simplicity. All functions return a result code. When a function could possibly need to do a memory allocation, a parameter will exist for a pointer to allocation callbacks. If you're after a terser API you should consider looking elsewhere or build your own wrapper.
I do not maintain version numbers for this library, nor do I guarantee API-compatibility. You need to look elsewhere if this is an issue for you.
To define the implementation, do this in one source file:
#define C89STR_IMPLEMENTATION
#include "c89str.h"
See the top of c89str.h for more details about the library.