2 Subject: Patch 6.3.080 (extra)
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Win32: With 'encoding' set to utf-8 while the current codepage is
12 Chinese editing a file with some specific characters in the name
14 Solution: Use _wfullpath() instead of _fullpath() when necessary.
18 *** ../vim-6.3.079/src/os_mswin.c Sun Dec 5 16:43:06 2004
19 --- src/os_mswin.c Sat Jul 2 13:07:35 2005
22 nResult = mch_dirname(buf, len);
25 - if (_fullpath(buf, fname, len - 1) == NULL)
27 ! STRNCPY(buf, fname, len); /* failed, use the relative path name */
29 ! #ifndef USE_FNAME_CASE
42 nResult = mch_dirname(buf, len);
47 ! if (enc_codepage >= 0 && (int)GetACP() != enc_codepage
48 ! # ifdef __BORLANDC__
49 ! /* Wide functions of Borland C 5.5 do not work on Windows 98. */
50 ! && g_PlatformId == VER_PLATFORM_WIN32_NT
55 ! WCHAR wbuf[MAX_PATH];
56 ! char_u *cname = NULL;
58 ! /* Use the wide function:
59 ! * - convert the fname from 'encoding' to UCS2.
60 ! * - invoke _wfullpath()
61 ! * - convert the result from UCS2 to 'encoding'.
63 ! wname = enc_to_ucs2(fname, NULL);
64 ! if (wname != NULL && _wfullpath(wbuf, wname, MAX_PATH - 1) != NULL)
66 ! cname = ucs2_to_enc((short_u *)wbuf, NULL);
69 ! STRNCPY(buf, cname, len);
77 ! if (nResult == FAIL) /* fall back to non-wide function */
80 + if (_fullpath(buf, fname, len - 1) == NULL)
82 + STRNCPY(buf, fname, len); /* failed, use relative path name */
97 *** ../vim-6.3.079/src/version.c Fri Jul 1 11:20:39 2005
98 --- src/version.c Mon Jul 4 12:18:34 2005
102 { /* Add new patch number below this line */
108 hundred-and-one symptoms of being an internet addict:
109 225. You sign up for free subscriptions for all the computer magazines
111 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
112 /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
113 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
114 \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///