From: Eli Zaretskii <eliz@gnu.org>
To: Kazuhiro Ito <kzhr@d1.dion.ne.jp>
Cc: 13515@debbugs.gnu.org
Subject: bug#13515: 24.3.50; file-name operating functions are broken on Japanese Windows
Date: Wed, 23 Jan 2013 18:21:16 +0200 [thread overview]
Message-ID: <83ham7na4j.fsf@gnu.org> (raw)
In-Reply-To: <87r4lcutm8.wl%%xmue@d1.dion.ne.jp>
> Date: Wed, 23 Jan 2013 18:38:23 +0900
> From: Kazuhiro Ito <kzhr@d1.dion.ne.jp>
> Cc: 13515@debbugs.gnu.org
>
> > > In addition, that change also let the below code fail.
> > >
> > > (let ((file-name-coding-system 'cp1252))
> > > (expand-file-name "漢字" "C:/"))
> > >
> > > -> "c:/ "
> >
> > IMO, this snippet doesn't make sense and cannot be supported.
> > expand-file-name calls a number of system APIs which need the file
> > name be encoded, so using file-name-coding-system that cannot possibly
> > encode a file name is not supposed to work.
> >
> > Do you have a real-life situation where such cases emerge and need to
> > be supported?
>
> None for me, sorry for inappropriate example. But the docstring of
> w32-downcase-file-names says it affects remote file names and the fix
> for Bug#12933 also affects other functions without using system APIs
> (e.g., file-name-directory).
On Windows, file-name-directory and similar functions do call system
APIs, for 2 reasons: (1) down-casing file names under
w32-downcase-file-names, and (2) advancing by characters in DBCS
locales, which can only be supported if file-name-coding-system is one
of the codepages known to Windows.
> I guess it would be better that these functions (except ones using
> system APIs) didn't depend on codepage. Does Emacs neither support
> the below code?
>
> (let ((file-name-coding-system 'cp1252))
> (file-name-directory "漢字/"))
>
> -> " /"
Well, "漢字/" is not a remote file name, so it is still subject to the
limitation that only file names that can be encoded by the
file-name-coding-system are supported. But even using a remote file
name, such as "/foo@bar.com:漢字/", gets butchered by
file-name-directory. However, this is a much broader issue, related
to Tramp and to other non-Windows specific aspects of file-name
handling, so I will start a discussion about that on emacs-devel.
Thanks for bringing up this point.
prev parent reply other threads:[~2013-01-23 16:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-21 13:48 bug#13515: 24.3.50; file-name operating functions are broken on Japanese Windows Kazuhiro Ito
2013-01-22 12:13 ` Eli Zaretskii
2013-01-22 13:27 ` Eli Zaretskii
2013-01-23 9:39 ` Kazuhiro Ito
2013-01-23 16:13 ` Eli Zaretskii
2013-01-23 16:54 ` Eli Zaretskii
2013-01-23 9:38 ` Kazuhiro Ito
2013-01-23 16:21 ` Eli Zaretskii [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83ham7na4j.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=13515@debbugs.gnu.org \
--cc=kzhr@d1.dion.ne.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.