unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
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: Tue, 22 Jan 2013 14:13:32 +0200	[thread overview]
Message-ID: <834ni9o1oz.fsf@gnu.org> (raw)
In-Reply-To: <87txqa7ikj.wl%%xmue@d1.dion.ne.jp>

> Date: Mon, 21 Jan 2013 22:48:44 +0900
> From: Kazuhiro Ito <kzhr@d1.dion.ne.jp>
> 
> The below code returns unexpected result in turnk on Windows.
> 
> (let ((file-name-coding-system 'cp932))
>   (expand-file-name "表" "C:/"))
> 
> -> "c:/\225/"
> 
> dostounix_filename does not support cp932 encoded string, which could
> contain '\\' as the part of Kankji characters.

Thanks, I will work on fixing this.

> 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.

> 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?





  reply	other threads:[~2013-01-22 12:13 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 [this message]
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

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=834ni9o1oz.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 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).