Introduction
Introduction Statistics Contact Development Disclaimer Help
tled: read utf-8 characters in led_readchar() - neatvi - [fork] simple vi-type …
git clone git://src.adamsgaard.dk/neatvi
Log
Files
Refs
README
---
commit 337895429257494f04d100a9d28c99ca013135d4
parent 67179ba66d7f2fd7b943722af8ae12c8a6486297
Author: Christian Neukirchen <[email protected]>
Date: Wed, 17 Jun 2015 22:58:24 +0430
led: read utf-8 characters in led_readchar()
Diffstat:
M led.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/led.c b/led.c
t@@ -183,7 +183,7 @@ static char *led_readchar(int c, char *kmap)
{
static char buf[8];
int c1, c2;
- int i;
+ int i, n;
if (c == TK_CTL('v')) { /* literal character */
buf[0] = term_read();
buf[1] = '\0';
t@@ -201,6 +201,14 @@ static char *led_readchar(int c, char *kmap)
return digraphs[i][1];
return NULL;
}
+ if ((c & 0xc0) == 0xc0) { /* utf-8 character */
+ buf[0] = c;
+ n = uc_len(buf);
+ for (i = 1; i < n; i++)
+ buf[i] = term_read();
+ buf[n] = '\0';
+ return buf;
+ }
return kmap_map(kmap, c);
}
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.