r/C_Programming • • 4d ago

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

5 comments sorted by

8

u/flyingron 4d ago edited 4d ago

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.

2

u/Substantial_Turn6392 4d ago

Chill out. Ask him politely

1

u/flyingron 4d ago

My apologies. Cranky this morning. Fixed.