diff options
author | nicm <nicm> | 2014-10-02 08:36:26 +0000 |
---|---|---|
committer | nicm <nicm> | 2014-10-02 08:36:26 +0000 |
commit | 2f19df09b1850d80e60f2d37f0b7f0db22eae6f7 (patch) | |
tree | 571344ba49bdf96207dd987de238298b16b908d4 /window-copy.c | |
parent | 045d0c3b9f616fe76b68d4551a6d66f410e760e8 (diff) |
Copy ACS characters as UTF-8, from Balazs Kezes.
Diffstat (limited to 'window-copy.c')
-rw-r--r-- | window-copy.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/window-copy.c b/window-copy.c index c9ddf84f..44fe6ae8 100644 --- a/window-copy.c +++ b/window-copy.c @@ -1552,6 +1552,7 @@ window_copy_copy_line(struct window_pane *wp, struct grid_line *gl; struct utf8_data ud; u_int i, xx, wrapped = 0; + const char *s; if (sx > ex) return; @@ -1580,6 +1581,13 @@ window_copy_copy_line(struct window_pane *wp, if (gc->flags & GRID_FLAG_PADDING) continue; grid_cell_get(gc, &ud); + if (ud.size == 1 && (gc->attr & GRID_ATTR_CHARSET)) { + s = tty_acs_get(NULL, ud.data[0]); + if (s != NULL && strlen(s) <= sizeof ud.data) { + ud.size = strlen(s); + memcpy (ud.data, s, ud.size); + } + } *buf = xrealloc(*buf, 1, (*off) + ud.size); memcpy(*buf + *off, ud.data, ud.size); |