Skip to content

Commit

Permalink
add a comment about branchless utf-8 decoders
Browse files Browse the repository at this point in the history
  • Loading branch information
nullgemm committed Nov 23, 2021
1 parent 730f49f commit 3b0812e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mechascribe.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ enum mechascribe_error mechascribe_set_text(

while (len > (utf8 - input))
{
// several optimized utf-8 decoders exist, but do not handle complex
// situations very well like when invalid codepoints are encountered
// so we prefer using the naive but robust approach instead
if (0xf0 == (0xf8 & utf8[0]))
{
*utf32 =
Expand Down

0 comments on commit 3b0812e

Please sign in to comment.