I've just found that expand-file-name returns unibyte string when name is unibyte, ignoring whether default-directory is multibyte or not.
(expand-file-name "file" "/home/horiguti/À") => "/home/horiguti/\201\300/file" (expand-file-name "fileÀ" "/home/horiguti/a") => "/home/horiguti/a/fileÀ" (expand-file-name "fileÀ" "/home/horiguti/À") => "/home/horiguti/À/fileÀ" The cause of this is that expand-file-name uses only NAME to determine the bytewidth of the return string. But DEFAULT-DIRECTORY is also needed. Attached patch fixes the bug, but I confirmed it only on GNU/Linux and MS-Windows. -- Kyotaro HORIGUCHI --- fileio.c 07 8 2005 12:33:16 +0000 1.552 +++ fileio.c 02 9 2005 16:35:19 +0000 @@ -1299,7 +1299,8 @@ { nm = sys_translate_unix (nm); return make_specified_string (nm, -1, strlen (nm), - STRING_MULTIBYTE (name)); + STRING_MULTIBYTE (name) + || STRING_MULTIBYTE (default_directory)); } #endif /* VMS */ #ifdef DOS_NT @@ -1331,7 +1332,8 @@ if (nm == SDATA (name)) return name; return make_specified_string (nm, -1, strlen (nm), - STRING_MULTIBYTE (name)); + STRING_MULTIBYTE (name) + || STRING_MULTIBYTE (default_directory)); #endif /* not DOS_NT */ } } @@ -1709,7 +1711,8 @@ #endif /* DOS_NT */ result = make_specified_string (target, -1, o - target, - STRING_MULTIBYTE (name)); + STRING_MULTIBYTE (name) + || STRING_MULTIBYTE (default_directory)); /* Again look to see if the file name has special constructs in it and perhaps call the corresponding file handler. This is needed _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel