OSDN Git Service

add utf-8 source detection
authorSHIRAKATA Kentaro <argrath@ub32.org>
Thu, 2 Sep 2021 08:22:11 +0000 (17:22 +0900)
committerSHIRAKATA Kentaro <argrath@ub32.org>
Sat, 9 Oct 2021 20:28:04 +0000 (05:28 +0900)
japanese/jlib.c

index 0777da2..c6977be 100644 (file)
@@ -34,7 +34,8 @@ static const char* ccode_alt[]={
 /* internal kcode */
 /* IC=0 EUC */
 /* IC=1 SJIS */
-#define IC ((unsigned char)("\8a¿"[0])==0x8a)
+/* IC=2 UTF8 */
+#define IC ((((unsigned char)("\8a¿"[0])==0xe6) ? 2 : ((unsigned char)("\8a¿"[0])==0x8a)))
 
 /* default input kcode */
 #ifndef INPUT_KCODE