Skip to content

Repository files navigation

libutf8

A whatwg compliant UTF8 encoding and decoding library based on this specification http://encoding.spec.whatwg.org/

install

clib:

$ clib install jwerle/libutf8

source:

$ make
$ make test
$ [sudo] make install

usage

#include<stdio.h>#include<stdlib.h>#include<assert.h>#include<utf8.h>intmain (void) {
charstr[] ="Foo © bar 𝌆 baz ☃ qux";
char*enc=NULL; char*dec=NULL;
enc=utf8_encode(str);
if (NULL==enc) {
utf8_perror("encode");
return1;
}
dec=utf8_decode(enc);
if (NULL==dec) {
utf8_perror("decode");
return1;
}
assert(0==strcmp(str, dec));
return0;
}

api

See utf8.h

license

MIT

About

A whatwg compliant UTF8 encoding and decoding library

Topics

Resources

Stars

35 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages