diff options
author | Tom Gundersen <teg@jklm.no> | 2014-12-22 00:58:26 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-12-22 20:26:53 +0100 |
commit | 2bb4c7e384c31de4727f1330da3f4de2f0bb7784 (patch) | |
tree | e6ca2bf55af1be1c20066533ef38f686fc40fc57 /src/libsystemd-terminal/subterm.c | |
parent | 856d6e09887730f115e43faf9577b479f2beb3c4 (diff) |
shared: utf8 - support ucs4 -> utf8
Originally we only supported ucs2, so move the ucs4 version from libsystemd-terminal to shared
and use that everywhere.
Diffstat (limited to 'src/libsystemd-terminal/subterm.c')
-rw-r--r-- | src/libsystemd-terminal/subterm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsystemd-terminal/subterm.c b/src/libsystemd-terminal/subterm.c index 78efc9d7c0..7c119ac58a 100644 --- a/src/libsystemd-terminal/subterm.c +++ b/src/libsystemd-terminal/subterm.c @@ -41,6 +41,7 @@ #include "sd-event.h" #include "term-internal.h" #include "util.h" +#include "utf8.h" typedef struct Output Output; typedef struct Terminal Terminal; @@ -459,7 +460,7 @@ static int output_draw_cell_fn(term_screen *screen, output_printf(o, " "); } else { for (k = 0; k < n_ch; ++k) { - ulen = term_utf8_encode(utf8, ch[k]); + ulen = utf8_encode_unichar(utf8, ch[k]); output_write(o, utf8, ulen); } } @@ -625,7 +626,7 @@ static int terminal_push_tmp(Terminal *t, uint32_t ucs4) { assert(t); - len = term_utf8_encode(buf, ucs4); + len = utf8_encode_unichar(buf, ucs4); if (len < 1) return 0; |