Skip to content

Commit

Permalink
lib: add comment in utf8_to_utf32_stream()
Browse files Browse the repository at this point in the history
The logic of utf8_to_utf32_stream() is not easy to understand.
Add a comment.

Signed-off-by: Heinrich Schuchardt <[email protected]>
  • Loading branch information
xypron authored and trini committed Jan 24, 2024
1 parent 3d878b8 commit 3150da3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/charset.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,10 @@ int utf8_to_utf32_stream(u8 c, char *buffer)
}
if (pos == end)
return 0;
/*
* Appending the byte lead to an invalid UTF-8 byte sequence.
* Consider it as the start of a new code sequence.
*/
*buffer = 0;
}
}

0 comments on commit 3150da3

Please sign in to comment.