r/C_Programming • u/Logical-Airport4842 • Oct 10 '26
Strict RFC 3629 UTF-8 Validator in C - Catches Overlongs and Surrogates
I needed a pure, zero-dependency UTF-8 validator for a systems project to protect user input boundaries like usernames.
Instead of a basic range check, this strictly follows the RFC 3629 spec to block security vulnerabilities like overlong encoding exploits (e.g. 0xC0 0xAF) and invalid UTF-16 surrogates.
1
Upvotes
8
u/flyingron Oct 10 '26 edited Oct 10 '26
Videos are a poor way to relay coding concepts. Further, if you want to share something or have a question, it would be best to link to the code rather than showing pictures of it.
1
u/space-resonator Oct 14 '26
Woow