cute_utf.h - Code paths to deal with malicious strings
As of now there's no logic to deal with invalidly encoded strings. Some code paths for this would be needed for a secure implementation.
I was thinking of maybe using two different functions -- one to validate the correctness of a string, and another that assumes correctness (which would be all the current functions as-is). This would be slightly inefficient to do string validation, but validation only has to happen once in the usual case, so I think the priority for most use-cases would instead be a really simple API over the most optimized run-time.
Reference: https://opensource.apple.com/source/tidy/tidy-2.2/tidy/src/utf8.c.auto.html
https://github.com/RandyGaul/cute_headers/issues/331