A Better UTF-8 Automaton

A Better UTF-8 Automaton
TL;DR: Any edge not shown goes to an error state.
Longer Read: Some C code implementing the above DFA is as follows. An extra SYNC state is added to the state machine, which absorbs continuation bytes. Luckily we can overlap the bits of neighboring states, if the start of one matches the end of another.
Read the full story at Orlp →
Related Skills: Software Design
Wider Reading: roadmap.sh — Software DesignRefactoring Guru — Software DesignCoursera — Software Design

💬 0 comments

No comments yet — be the first to say what you think.