unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kazuhiro Ito <kzhr@d1.dion.ne.jp>
To: Eli Zaretskii <eliz@gnu.org>
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:38:23 +0900	[thread overview]
Message-ID: <87r4lcutm8.wl%%xmue@d1.dion.ne.jp> (raw)
In-Reply-To: <834ni9o1oz.fsf@gnu.org>

> > By the fix for Bug#12933, dostounix_filename could receive such
> > string.
> 
> Before that fix, dostounix_filename would indeed accept such file
> names, but what it did with them was exhibiting undefined behavior,
> because it treated multibyte strings in Emacs internal representation
> as if they were simple unibyte strings.

Agreed.  On Japanese Windows, Emacs had been able to treat file name
strings correctly in many years accidentally.

 > > 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).  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 "漢字/"))

-> "  /"

-- 
Kazuhiro Ito





  parent reply	other threads:[~2013-01-23  9:38 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 [this message]
2013-01-23 16:21     ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r4lcutm8.wl%%xmue@d1.dion.ne.jp \
    --to=kzhr@d1.dion.ne.jp \
    --cc=13515@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).