From daed589b5c2c0935787754ff3402aca68a820802 Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Sat, 9 Feb 2008 19:30:37 +0000 Subject: Handle (normal cases) of UTF-8 - still doesn't handle C1/UTF-8 range yet --- termkey.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'termkey.h') diff --git a/termkey.h b/termkey.h index 6a8c543..d82e473 100644 --- a/termkey.h +++ b/termkey.h @@ -90,9 +90,9 @@ typedef struct { int code; int flags; - /* Any Unicode character can be UTF-8 encoded in no more than 5 bytes, plus + /* Any Unicode character can be UTF-8 encoded in no more than 6 bytes, plus * terminating NUL */ - char utf8[6]; + char utf8[7]; } termkey_key; typedef struct termkey termkey_t; @@ -100,6 +100,8 @@ typedef struct termkey termkey_t; enum { TERMKEY_FLAG_NOINTERPRET = 0x01, // Do not interpret C0//G1 codes if possible TERMKEY_FLAG_CONVERTKP = 0x02, // Convert KP codes to regular keypresses + TERMKEY_FLAG_RAW = 0x04, // Input is raw bytes, not UTF-8 + TERMKEY_FLAG_UTF8 = 0x08, // Input is definitely UTF-8 }; termkey_t *termkey_new(int fd, int flags); -- cgit v1.2.3-54-g00ecf