Procházet zdrojové kódy

* Really export IRC as UTF-8, as advertised in the documentation.

tags/v0.99.beta14
Sam Hocevar sam před 18 roky
rodič
revize
1372caac6c
1 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. +4
    -4
      cucul/export.c

+ 4
- 4
cucul/export.c Zobrazit soubor

@@ -484,15 +484,15 @@ static void export_irc(cucul_canvas_t *cv, cucul_buffer_t *ex)
char *cur;
unsigned int x, y;

/* 11 bytes assumed for max length per pixel. Worst case scenario:
/* 16 bytes assumed for max length per pixel. Worst case scenario:
* ^Cxx,yy 6 bytes
* ^B^B 2 bytes
* ch 1 byte
* ch 6 bytes
* \r\n 2 bytes
* In real life, the average bytes per pixel value will be around 5.
*/

ex->size = 2 + (cv->width * cv->height * 11);
ex->size = 2 + (cv->width * cv->height * 16);
ex->data = malloc(ex->size);

cur = ex->data;
@@ -543,7 +543,7 @@ static void export_irc(cucul_canvas_t *cv, cucul_buffer_t *ex)
cur += sprintf(cur, "\x02\x02");
}
#endif
*cur++ = ch & 0x7f;
cur += cucul_utf32_to_utf8(cur, ch);
prevfg = fg;
prevbg = bg;
}


Načítá se…
Zrušit
Uložit