bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#13515: 24.3.50; file-name operating functions are broken on Japanese


From: Eli Zaretskii
Subject: bug#13515: 24.3.50; file-name operating functions are broken on Japanese Windows
Date: Tue, 22 Jan 2013 14:13:32 +0200

> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]