Unified · Split
| @@ -349,10 +349,10 @@ ST_INLN char *unicode_to_utf8 (char *b, uint32_t Uc) · 348 unmodified lines | |||
| 349 | { | 349 | { |
| 350 | if (Uc<0x80) *b++=Uc; | 350 | if (Uc<0x80) *b++=Uc; |
| 351 | else if (Uc<0x800) *b++=192+Uc/64, *b++=128+Uc%64; | 351 | else if (Uc<0x800) *b++=192+Uc/64, *b++=128+Uc%64; |
| 352 | else if (Uc-0xd800u<0x800) return b; | 352 | else if (Uc-0xd800u<0x800) goto error; |
| 353 | else if (Uc<0x10000) *b++=224+Uc/4096, *b++=128+Uc/64%64, *b++=128+Uc%64; | 353 | else if (Uc<0x10000) *b++=224+Uc/4096, *b++=128+Uc/64%64, *b++=128+Uc%64; |
| 354 | else if (Uc<0x110000) *b++=240+Uc/262144, *b++=128+Uc/4096%64, *b++=128+Uc/64%64, *b++=128+Uc%64; | 354 | else if (Uc<0x110000) *b++=240+Uc/262144, *b++=128+Uc/4096%64, *b++=128+Uc/64%64, *b++=128+Uc%64; |
| 355 | else tcc_error("0x%x is not a valid universal character", Uc); | 355 | else error: tcc_error("0x%x is not a valid universal character", Uc); |
| 356 | return b; | 356 | return b; |
| 357 | } | 357 | } |
| 358 | 358 | ||