Loading ...
Sorry, an error occurred while loading the content.

14861Re: Vim can't use filename having MBYTE

Expand Messages
  • mattn@mail.goo.ne.jp
    Aug 1, 2000
    • 0 Attachment
      Bram@... wrote:
      > Changing the order of initializations is very dangerous. In this case the
      > vimrc file can do just about anything with file specified in the command line,
      > this it should be run with a valid set of arguments. But since 'isfname' can
      > be set in the vimrc, expanding may work differently after it.

      I hope that setting p_cc before calling "rem_backslash".
      I do "set fileencoding=japan" in vimrc, Is it too later?

      > This is a tough chicken-egg problem. I really don't know a good solution.
      > Perhaps it would be sufficient to initialise chartab[] first, assuming that
      > all characters above 0x80 are filename characters?

      Japanese people use few characterset.
      It is called "shift_jis", "euc-jp", etc.
      Japanese MS-Windows use "shift_jis", but there is UNIX used "euc-jp".
      They are composed with lead-byte and trail-byte.

      If using "shift_jis", trail-byte don't have backslash.
      But using "euc-jp", trail-byte may have backslash.
      Thus, it is necessary for skipping trail-byte by lead-byte and way of encoding.
      However, both have something in using non-ascii for lead-byte.
      So how about below solution?

      If on specified backslash lead-char, (it is not path-separator.)
      next character should be single-byte character. It may be ascii.

      char_u *str;
      return (str[0] == '\\'
      #ifdef FEAT_MBYTE
      && isascii(str[1])
      && (str[1] == ' '
      || (str[1] != NUL
      && str[1] != '*'
      && str[1] != '?'
      && !vim_isfilec(str[1]))));
      return (str[0] == '\\' && str[1] != NUL);

      Yasuhiro Matsumoto
    • Show all 10 messages in this topic