Two simple functions to encode and decode UTF-8 from/to its Unicode code points using bitwise operators. A third function to get the size of a UTF-8 character from its first byte.
The Makefile is for Linux, however the code itself should compile on any platform.
The header file is in ./include/utf8encoder.h
.
Build the shared object:
# Builds ./bin/libutf8encoder.so
make shared
Build the static library:
# Builds ./bin/libutf8encoder.a
make static
The default target make
is the static library.
Shared object test:
make sharedtest
Static library test:
make test