How to check if a string is valid utf-8

Posté le mar. 04 avril 2017 dans blog

Every day (at least) I'm facing a problem: how to check if a string is valid in utf-8 ? So I wrote a little C program, that I put on my github. Just be aware that pure ASCII is valid UTF-8 and that's not a bug: my program is checking if a string is valid utf-8, not if the string is in utf-8. Enjoy :-)