From: Steve Bennett Date: Tue, 13 Sep 2011 22:57:13 +0000 (+1000) Subject: Better treatment of high-bit chars for non-utf8 X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=5107749111aab9f78c9396f5490a5dc2483de748;p=linenoise.git Better treatment of high-bit chars for non-utf8 Signed-off-by: Steve Bennett --- diff --git a/utf8.h b/utf8.h index 564d64e..11dc51b 100644 --- a/utf8.h +++ b/utf8.h @@ -13,7 +13,7 @@ /* No utf-8 support. 1 byte = 1 char */ #define utf8_strlen(S, B) (B) < 0 ? (int)strlen(S) : (B) -#define utf8_tounicode(S, CP) (*(CP) = *(S), 1) +#define utf8_tounicode(S, CP) (*(CP) = (unsigned char)*(S), 1) #define utf8_index(C, I) (I) #define utf8_charlen(C) 1