Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jwerle/libutf8
A whatwg compliant UTF8 encoding and decoding library
https://github.com/jwerle/libutf8
c decode encode library utf8
Last synced: 22 days ago
JSON representation
A whatwg compliant UTF8 encoding and decoding library
- Host: GitHub
- URL: https://github.com/jwerle/libutf8
- Owner: jwerle
- License: mit
- Created: 2013-11-19T14:25:43.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2019-08-08T20:22:57.000Z (over 5 years ago)
- Last Synced: 2024-10-17T21:03:41.890Z (24 days ago)
- Topics: c, decode, encode, library, utf8
- Language: C
- Size: 14.6 KB
- Stars: 34
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
libutf8
=======A whatwg compliant UTF8 encoding and decoding library based on this specification [http://encoding.spec.whatwg.org/](http://encoding.spec.whatwg.org/)
## install
***clib***:
```sh
$ clib install jwerle/libutf8
```***source***:
```sh
$ make
$ make test
$ [sudo] make install
```## usage
```c
#include
#include
#include
#includeint
main (void) {
char str[] = "Foo © bar 𝌆 baz ☃ qux";
char *enc = NULL;
char *dec = NULL;enc = utf8_encode(str);
if (NULL == enc) {
utf8_perror("encode");
return 1;
}dec = utf8_decode(enc);
if (NULL == dec) {
utf8_perror("decode");
return 1;
}assert(0 == strcmp(str, dec));
return 0;
}
```## api
See [utf8.h](https://github.com/jwerle/libutf8/blob/master/utf8.h)
## license
MIT