Skip to main content
Code Review

Return to Question

replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

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.

edited tags
Link
200_success
  • 145.5k
  • 22
  • 190
  • 479
added 4 characters in body
Source Link
Remo.D
  • 355
  • 1
  • 9

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.

added 83 characters in body
Source Link
Remo.D
  • 355
  • 1
  • 9
Loading
Source Link
Remo.D
  • 355
  • 1
  • 9
Loading
lang-c

AltStyle によって変換されたページ (->オリジナル) /