Skip to content

Simple functions to encode and decode UTF-8 using bitwise operators.

License

Notifications You must be signed in to change notification settings

penguin-teal/utf8encoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build

utf8encoder

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.

Header

The header file is in ./include/utf8encoder.h.

Building

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.

Run Tests

Shared object test:

make sharedtest

Static library test:

make test