- if(b<0xc0) {
- // trail byte: collect a multi-byte character
- c=utf8_prevCharSafeBody(s, 0, &length, b, -1);
- if(c<0) {
- c=0xfffd;
- }
- } else {
- // lead byte in last-trail position
- c=0xfffd;
- }
+ // trail byte: collect a multi-byte character
+ // (or lead byte in last-trail position)
+ c=utf8_prevCharSafeBody(s, 0, &length, b, -3);