瀏覽代碼

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

tags/v0.99.beta14
Sam Hocevar sam 18 年之前
父節點
當前提交
1372caac6c
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. +4
    -4
      cucul/export.c

+ 4
- 4
cucul/export.c 查看文件

@@ -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;
}


Loading…
取消
儲存