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

Re: Vim can't use filename having MBYTE

Expand Messages
  • Bram Moolenaar
    ... Again you found the right place to fix the problem, but it doesn t take care of UTF-8. UTF-8 encoding uses up to six bytes for one character. That s
    Message 1 of 2 , Jul 28, 2000
    • 0 Attachment
      Yasuhiro Matsumoto wrote:

      > When having MBYTE in filename of arguments,
      > if it have backslash code then Vim can't read file.
      > (Vim create [New File])

      Again you found the right place to fix the problem, but it doesn't take care
      of UTF-8. UTF-8 encoding uses up to six bytes for one character. That's
      unlike the two-byte encodings supported before Vim 6.0.

      Try this patch instead:

      *** misc1.c~ Sun Jul 23 16:40:11 2000
      --- misc1.c Fri Jul 28 10:47:37 2000
      ***************
      *** 3238,3247 ****

      if (fname == NULL)
      return (char_u *)"";
      ! for (p1 = p2 = fname; *p2; ++p2) /* find last part of path */
      {
      if (vim_ispathsep(*p2))
      p1 = p2 + 1;
      }
      return p1;
      }
      --- 3238,3253 ----

      if (fname == NULL)
      return (char_u *)"";
      ! for (p1 = p2 = fname; *p2; ) /* find last part of path */
      {
      if (vim_ispathsep(*p2))
      p1 = p2 + 1;
      + #ifdef FEAT_MBYTE
      + if (has_mbyte)
      + p2 += mb_ptr2len_check(p2);
      + else
      + #endif
      + ++p2;
      }
      return p1;
      }

      By the way, please use ordinary English/ASCII text in the subject, not all
      mail software can decode the MIME encoding setting.

      --
      hundred-and-one symptoms of being an internet addict:
      38. You wake up at 3 a.m. to go to the bathroom and stop and check your e-mail
      on the way back to bed.

      /// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
      \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
    Your message has been successfully submitted and would be delivered to recipients shortly.