diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-06-16 16:18:26 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-06-16 16:18:26 -0700 |
commit | e45c1ce281933f5cc6662d14e03feb195a289143 (patch) | |
tree | f8c0c8b029be6bc5c07f73d3d0735a01a4641ef4 /termbox | |
parent | 7b7aa5f66c756198b9cfdf2f616bb98e2c84c7b8 (diff) | |
download | mu-e45c1ce281933f5cc6662d14e03feb195a289143.tar.gz |
1573
Diffstat (limited to 'termbox')
-rw-r--r-- | termbox/termbox.c | 8 | ||||
-rw-r--r-- | termbox/termbox.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/termbox/termbox.c b/termbox/termbox.c index eed9681d..ee10cd49 100644 --- a/termbox/termbox.c +++ b/termbox/termbox.c @@ -427,6 +427,14 @@ static void send_char(int x, int y, uint32_t c) bytebuffer_puts(&output_buffer, buf); } +const char* to_unicode(uint32_t c) +{ + static char buf[7]; + int bw = tb_utf8_unicode_to_char(buf, c); + buf[bw] = '\0'; + return buf; +} + static void send_clear(void) { send_attr(foreground, background); diff --git a/termbox/termbox.h b/termbox/termbox.h index 9b7fd772..50a8b5e1 100644 --- a/termbox/termbox.h +++ b/termbox/termbox.h @@ -203,6 +203,7 @@ int tb_poll_event(struct tb_event *event); int tb_utf8_char_length(char c); int tb_utf8_char_to_unicode(uint32_t *out, const char *c); int tb_utf8_unicode_to_char(char *out, uint32_t c); +const char* to_unicode(uint32_t c); #ifdef __cplusplus } |