From 5107749111aab9f78c9396f5490a5dc2483de748 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Wed, 14 Sep 2011 08:57:13 +1000 Subject: [PATCH] Better treatment of high-bit chars for non-utf8 Signed-off-by: Steve Bennett --- utf8.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.44.0