From cc9fce814c4ca4ea79227bb5d32afc17166740f6 Mon Sep 17 00:00:00 2001 From: SHIRAKATA Kentaro Date: Thu, 2 Sep 2021 17:22:11 +0900 Subject: [PATCH] add utf-8 source detection --- japanese/jlib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/japanese/jlib.c b/japanese/jlib.c index 0777da2..c6977be 100644 --- a/japanese/jlib.c +++ b/japanese/jlib.c @@ -34,7 +34,8 @@ static const char* ccode_alt[]={ /* internal kcode */ /* IC=0 EUC */ /* IC=1 SJIS */ -#define IC ((unsigned char)("Š¿"[0])==0x8a) +/* IC=2 UTF8 */ +#define IC ((((unsigned char)("Š¿"[0])==0xe6) ? 2 : ((unsigned char)("Š¿"[0])==0x8a))) /* default input kcode */ #ifndef INPUT_KCODE -- 2.11.0