Can you encode UTF-8 without branches? Yes. The question In a Recurse chat, Nathan Goldbaum asked: I know how to decode UTF-8 using bitmath and some LUTs (see https://github.com/skeeto/branchless-utf8), but if I want to to go from a codepoint to UTF-8, is there a way to do it without branches? To start with, is there a way to write this C function, which returns the number of bytes needed to store