- Timestamp:
- Nov 2, 2008, 11:12:24 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca/codec/export.c
r3224 r3227 504 504 * A glyph: up to 48 chars for "<td bgcolor=\"#xxxxxx\"><tt><font color=\"#xxxxxx\">" 505 505 * up to 36 chars for "<b><i><u><blink></blink></u></i></b>" 506 * up to 9 chars for "&#xxxxxx;" (far less for pure ASCII)506 * up to 10 chars for "&#xxxxxxx;" (far less for pure ASCII) 507 507 * 17 chars for "</font></tt></td>" */ 508 *bytes = 1000 + cv->height * (10 + maxcols * (48 + 36 + 9+ 17));508 *bytes = 1000 + cv->height * (10 + maxcols * (48 + 36 + 10 + 17)); 509 509 cur = data = malloc(*bytes); 510 510 … … 584 584 if(linechar[x + i] == CACA_MAGIC_FULLWIDTH) 585 585 ; 586 else if(linechar[x + i] <= 0x00000020) 586 else if((linechar[x + i] <= 0x00000020) 587 || 588 ((linechar[x + i] >= 0x0000007f) 589 && 590 (linechar[x + i] <= 0x0000009f))) 587 591 { 588 592 /* Control characters and space converted to … … 614 618 else if(linechar[x + i] < 0x00000080) 615 619 cur += sprintf(cur, "%c", (uint8_t)linechar[x + i]); 620 else if((linechar[x + i] <= 0x0010fffd) 621 && 622 ((linechar[x + i] & 0x0000fffe) != 0x0000fffe) 623 && 624 ((linechar[x + i] < 0x0000d800) 625 || 626 (linechar[x + i] > 0x0000dfff))) 627 cur += sprintf(cur, "&#%i;", (unsigned int)linechar[x + i]); 616 628 else 617 cur += sprintf(cur, "&#%i;", (unsigned int)linechar[x + i]); 629 /* non-character codepoints become U+FFFD 630 * REPLACEMENT CHARACTER */ 631 cur += sprintf(cur, "&#%i;", (unsigned int)0x0000fffd); 618 632 619 633 if (((i + 1) == len) || (lineattr[x + i + 1] != lineattr[x + i]))
Note: See TracChangeset
for help on using the changeset viewer.