|
据说vim6.2会认为中文全角符号为英文半角,所以显示会有问题。(我的没有出现过 然后这个patch会加上GB18030的支持。代码很短,我贴出来算了
- --- vim62/src/mbyte.c 2003-06-01 00:12:56.000000000 +0800
- +++ vim62.new/src/mbyte.c 2003-07-30 23:06:57.000000000 +0800
- @@ -267,6 +267,7 @@
- {"5601", IDX_EUC_KR}, /* Sun: KS C 5601 */
- {"euccn", IDX_EUC_CN},
- {"gb2312", IDX_EUC_CN},
- + {"gb18030", IDX_EUC_CN},
- {"euctw", IDX_EUC_TW},
- #if defined(WIN3264) || defined(WIN32UNIX) || defined(MACOS)
- {"japan", IDX_CP932},
- @@ -959,9 +960,19 @@
- * When p_ambw is "double", return 2 for a character with East Asian Width
- * class 'A'(mbiguous).
- */
- - int
- -utf_char2cells(c)
- - int c;
- +
- +static int _utf_char2cells(int c);
- +int utf_char2cells(c)
- +{
- +#if 0
- + fprintf(stderr, "enc_dbcs=%d(%d), c = %x, ret = %d\n",
- + enc_dbcs, DBCS_CHSU, c, _utf_char2cells(c));
- +#endif
- + return (c >= 0x80 && enc_dbcs == DBCS_CHSU) ? 2 : _utf_char2cells(c);
- +}
- +
- +static int _utf_char2cells(c)
- + int c;
- {
- /* sorted list of non-overlapping intervals of East Asian Ambiguous
- * characters, generated with:
- @@ -4997,6 +5008,12 @@
- int from_prop;
- int to_prop;
-
- + if (from != NULL && !strcmp(from, "euc-cn"))
- + from = "gb18030";
- +
- + if (to != NULL && !strcmp(to, "euc-cn"))
- + to = "gb18030";
- +
- /* Reset to no conversion. */
- # ifdef USE_ICONV
- if (vcp->vc_type == CONV_ICONV && vcp->vc_fd != (iconv_t)-1)
复制代码 |
|