This is the complete rewrite of a function to decode an UTF-8 codepoints and return the encoding length (or 0
if the codepoint is 0円
). In response to the review of my previous version review of my previous version I decided that I needed a different approach and I should recognize ALL the invalid encodings (as per reviewer suggestion). If an invalid encoding is found, the first byte is returned with length 1
.
This is the complete rewrite of a function to decode an UTF-8 codepoints and return the encoding length (or 0
if the codepoint is 0円
). In response to the review of my previous version I decided that I needed a different approach and I should recognize ALL the invalid encodings (as per reviewer suggestion). If an invalid encoding is found, the first byte is returned with length 1
.
This is the complete rewrite of a function to decode an UTF-8 codepoints and return the encoding length (or 0
if the codepoint is 0円
). In response to the review of my previous version I decided that I needed a different approach and I should recognize ALL the invalid encodings (as per reviewer suggestion). If an invalid encoding is found, the first byte is returned with length 1
.
I also compared my code with one directly based on the original version by Bjoern Hoehrmann (using a table to represent the FSM) and I found it having the same speedthem being equally fast but mine being much clearer in terms of understanding how it works.
I also compared my code with one directly based on the original version by Bjoern Hoehrmann (using a table to represent the FSM) and I found it having the same speed but being much clearer in terms of understanding how it works.
I also compared my code with one directly based on the original version by Bjoern Hoehrmann (using a table to represent the FSM) and I found them being equally fast but mine being much clearer in terms of understanding how it works.