Ignore:
Timestamp:
Mar 8, 2006, 11:29:00 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Make output drivers more error resilient when handling UTF-32 characters, by simply ignoring everything non ASCII :-)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/driver_win32.c

    r553 r557  
    199199    for(i = 0; i < kk->qq->width * kk->qq->height; i++)
    200200    {
    201         kk->drv.p->buffer[i].Char.AsciiChar = kk->qq->chars[i] & 0x7f;
     201        uint32_t c = kk->qq->chars[i];
     202
     203        if(c > 0x00000020 && c < 0x00000080)
     204            kk->drv.p->buffer[i].Char.AsciiChar = (char)c;
     205        else
     206            kk->drv.p->buffer[i].Char.AsciiChar = ' ';
     207
    202208        kk->drv.p->buffer[i].Attributes =
    203209                win32_fg_palette[kk->qq->attr[i] & 0xf]
Note: See TracChangeset for help on using the changeset viewer.