A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jwerle/libutf8 below:

jwerle/libutf8: A whatwg compliant UTF8 encoding and decoding library

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

clib:

$ clib install jwerle/libutf8

source:

$ make
$ make test
$ [sudo] make install
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <utf8.h>

int
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;
}

See utf8.h

MIT


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4