utf8checker.c - Routines to check a byte stream for valid utf-8 utf8checker.h - Header file for utf8checker.c utf8checkerdemo.c - Demo that checks the given file verbosely utf8checkerdemofixed.c - Demo that checks four hard-coded byte arrays This is a little bit of C code I wrote in response to a question on stackoverflow.com about how to verify that a byte stream was valid utf-8 manually. It's only been tested to the extent that the two included demo programs have been run and I'm satisfied with the results. Anyone's free to use the algorithms contained in the code at their own risk, and the code itself under the Apache license (v. 2.0). (if that license doesn't work for you, contact me and I'll probably be willing to relicense the code under some additional license) Daniel Martin , 21-May-2009