--- estruct.h 2020/08/23 19:03:03 1.757 +++ estruct.h 2020/11/29 22:41:44 @@ -1316,10 +1316,14 @@ * True if the buffer contents are in UTF-8 (or -16, -32). */ #if OPT_MULTIBYTE +#define global_is_utfXX() ((global_b_val(VAL_FILE_ENCODING) >= enc_UTF8) \ + || (global_b_val(VAL_FILE_ENCODING) == enc_LOCALE \ + && vl_encoding >= enc_UTF8)) #define b_is_utfXX(bp) ((b_val(bp, VAL_FILE_ENCODING) >= enc_UTF8) \ || (b_val(bp, VAL_FILE_ENCODING) == enc_LOCALE \ && vl_encoding >= enc_UTF8)) #else +#define global_is_utfXX() 0 #define b_is_utfXX(bp) 0 #endif --- insert.c 2015/03/13 10:29:15 1.184 +++ insert.c 2020/11/29 22:44:16 @@ -1039,7 +1039,7 @@ while (n--) { tp = tstring; while (*tp) { - if ((status = inschar(*tp++, &backsp_limit)) != TRUE) { + if ((status = inschar(CharOf(*tp++), &backsp_limit)) != TRUE) { n = 0; break; } --- line.c 2019/12/19 09:32:10 1.235 +++ line.c 2020/11/29 22:43:43 @@ -542,7 +542,7 @@ int nn; int mapped; - if ((c > 127) && b_is_utfXX(curbp)) { + if (!global_is_utfXX() && (c > 127) && b_is_utfXX(curbp)) { nbytes = vl_conv_to_utf8(target, (UINT) c, sizeof(target)); } else if (okCTYPE2(vl_wide_enc) && !vl_mb_is_8bit(c)) { nbytes = 1;