version 1.15, 2009/10/13 15:38:37 |
version 1.16, 2009/11/18 17:02:17 |
|
|
const struct grid_cell *gc; |
const struct grid_cell *gc; |
const struct grid_utf8 *gu; |
const struct grid_utf8 *gu; |
char *buf; |
char *buf; |
size_t len, off; |
size_t len, off, size; |
u_int xx, i; |
u_int xx; |
|
|
GRID_DEBUG(gd, "px=%u, py=%u, nx=%u", px, py, nx); |
GRID_DEBUG(gd, "px=%u, py=%u, nx=%u", px, py, nx); |
|
|
|
|
continue; |
continue; |
|
|
if (gc->flags & GRID_FLAG_UTF8) { |
if (gc->flags & GRID_FLAG_UTF8) { |
while (len < off + UTF8_SIZE + 1) { |
gu = grid_peek_utf8(gd, xx, py); |
|
|
|
size = grid_utf8_size(gu); |
|
while (len < off + size + 1) { |
buf = xrealloc(buf, 2, len); |
buf = xrealloc(buf, 2, len); |
len *= 2; |
len *= 2; |
} |
} |
|
|
gu = grid_peek_utf8(gd, xx, py); |
off += grid_utf8_copy(gu, buf + off, len - off); |
for (i = 0; i < UTF8_SIZE; i++) { |
|
if (gu->data[i] == 0xff) |
|
break; |
|
buf[off++] = gu->data[i]; |
|
} |
|
} else { |
} else { |
while (len < off + 2) { |
while (len < off + 2) { |
buf = xrealloc(buf, 2, len); |
buf = xrealloc(buf, 2, len); |