Skip to content
/ utf Public

A minimal library for processing byte-strings and byte-streams as UTF-8

License

Notifications You must be signed in to change notification settings

phonologus/utf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The files utf.c and utf.h constitute a minimal library for processing bi-directional strings/streams of bytes as UTF-8.

The library is intended to facilitate adding Unicode-awareness to legacy text processing applications, with the minimum of disruption to any existing byte-processing.

The stream processing functions in the library expect to be passed a getter function of type int (*getter)(void). This is in lieu of a closure, so the legacy application's own getter functions will likely need a shim, along the lines of

static FILE *gfile;

int
fgetter(void)
{
   return fget(gfile);
}

int
fgetu8(FILE *f, char *buf)
{
   gfile=f;
   return u8getc(fgetter,buf);
}   

About

A minimal library for processing byte-strings and byte-streams as UTF-8

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages