strcat (res, "/");
beg = res;
p = beg + strlen (beg);
- dostounix_filename (beg, 0);
+ dostounix_filename (beg);
+ /* FIXME: Figure out the multibyte vs unibyte stuff here. */
tem_fn = make_specified_string (beg, -1, p - beg,
STRING_MULTIBYTE (filename));
}
else if (STRING_MULTIBYTE (filename))
{
tem_fn = make_specified_string (beg, -1, p - beg, 1);
- dostounix_filename (SSDATA (tem_fn), 1);
+ dostounix_filename (SSDATA (tem_fn));
#ifdef WINDOWSNT
if (!NILP (Vw32_downcase_file_names))
tem_fn = Fdowncase (tem_fn);
}
else
{
- dostounix_filename (beg, 0);
+ dostounix_filename (beg);
tem_fn = make_specified_string (beg, -1, p - beg, 0);
}
return tem_fn;
dst[srclen++] = DIRECTORY_SEP;
dst[srclen] = 0;
#ifdef DOS_NT
- dostounix_filename (dst, multibyte);
+ dostounix_filename (dst);
#endif
return srclen;
}
memcpy (dst, src, srclen);
dst[srclen] = 0;
#ifdef DOS_NT
- dostounix_filename (dst, multibyte);
+ dostounix_filename (dst);
#endif
return srclen;
}
#ifdef DOS_NT
/* Make sure directories are all separated with /, but
avoid allocation of a new string when not required. */
- dostounix_filename (nm, multibyte);
+ /* FIXME: Figure out multibyte and downcase here. */
+ dostounix_filename (nm);
#ifdef WINDOWSNT
if (IS_DIRECTORY_SEP (nm[1]))
{
nm++;
/* `egetenv' may return a unibyte string, which will bite us since
we expect the directory to be multibyte. */
- tem = build_string (newdir);
+#ifdef WINDOWSNT
+ if (newdir[0])
+ {
+ char newdir_utf8[MAX_UTF8_PATH];
+
+ filename_from_ansi (newdir, newdir_utf8);
+ tem = build_string (newdir_utf8);
+ }
+ else
+#else
+ tem = build_string (newdir);
+#endif
if (multibyte && !STRING_MULTIBYTE (tem))
{
hdir = DECODE_FILE (tem);
indirectly by prepending newdir to nm if necessary, and using
cwd (or the wd of newdir's drive) as the new newdir. */
char *adir;
+#ifdef WINDOWSNT
+ const int adir_size = MAX_UTF8_PATH;
+#else
+ const int adir_size = MAXPATHLEN + 1;
+#endif
if (IS_DRIVE (newdir[0]) && IS_DEVICE_SEP (newdir[1]))
{
strcat (tmp, nm);
nm = tmp;
}
- adir = alloca (MAXPATHLEN + 1);
+ adir = alloca (adir_size);
if (drive)
{
if (!getdefdir (c_toupper (drive) - 'A' + 1, adir))
strcpy (adir, "/");
}
else
- getcwd (adir, MAXPATHLEN + 1);
+ getcwd (adir, adir_size);
if (multibyte)
{
Lisp_Object tem = build_string (adir);
target[1] = ':';
}
result = make_specified_string (target, -1, o - target, multibyte);
- dostounix_filename (SSDATA (result), multibyte);
+ /* FIXME: Figure out the multibyte and downcase here. */
+ dostounix_filename (SSDATA (result));
#ifdef WINDOWSNT
if (!NILP (Vw32_downcase_file_names))
result = Fdowncase (result);
nm = xlispstrdupa (filename);
#ifdef DOS_NT
- dostounix_filename (nm, multibyte);
+ /* FIXME: Figure out multibyte and downcase. */
+ dostounix_filename (nm);
substituted = (memcmp (nm, SDATA (filename), SBYTES (filename)) != 0);
#endif
endp = nm + SBYTES (filename);
if (!buf)
return Qnil;
- val = build_string (buf);
+ val = build_unibyte_string (buf);
if (buf[0] == '/' && strchr (buf, ':'))
- val = concat2 (build_string ("/:"), val);
+ val = concat2 (build_unibyte_string ("/:"), val);
if (buf != readlink_buf)
xfree (buf);
val = DECODE_FILE (val);
DEFVAR_LISP ("file-name-coding-system", Vfile_name_coding_system,
doc: /* Coding system for encoding file names.
-If it is nil, `default-file-name-coding-system' (which see) is used. */);
+If it is nil, `default-file-name-coding-system' (which see) is used.
+
+On MS-Windows, the value of this variable is largely ignored if
+\`w32-unicode-filenames' (which see) is non-nil. Emacs on Windows
+behaves as if file names were encoded in `utf-8'. */);
Vfile_name_coding_system = Qnil;
DEFVAR_LISP ("default-file-name-coding-system",
This variable is set/changed by the command `set-language-environment'.
User should not set this variable manually,
instead use `file-name-coding-system' to get a constant encoding
-of file names regardless of the current language environment. */);
+of file names regardless of the current language environment.
+
+On MS-Windows, the value of this variable is largely ignored if
+\`w32-unicode-filenames' (which see) is non-nil. Emacs on Windows
+behaves as if file names were encoded in `utf-8'. */);
Vdefault_file_name_coding_system = Qnil;
DEFSYM (Qformat_decode, "format-decode");