GNU bug report logs - #15426
24.3.50; Multibyte filenames and directory-files in unibyte buffer

Previous Next

Package: emacs;

Reported by: Andreas Politz <politza <at> hochschule-trier.de>

Date: Fri, 20 Sep 2013 16:49:01 UTC

Severity: normal

Found in version 24.3.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andreas Politz <politza <at> hochschule-trier.de>
Cc: 15426 <at> debbugs.gnu.org
Subject: bug#15426: 24.3.50; Multibyte filenames and directory-files in unibyte buffer
Date: Fri, 20 Sep 2013 20:46:03 +0300
> From: Andreas Politz <politza <at> hochschule-trier.de>
> Date: Fri, 20 Sep 2013 18:47:54 +0200
> 
> There seems to be something going wrong with the
> encoding/decoding of multibyte filenames from a unibyte buffer in
> recursive calls to directory-files.
> 
> $ emacs -Q 
> 
> (setq d "/tmp/Ä")
> "/tmp/Ä"
> 
> (make-directory d t)
> nil
> 
> (toggle-enable-multibyte-characters)
> t
> 
> (car (directory-files d t))
> "/tmp/Ä/."
> 
> (car (directory-files (car (directory-files d t)) t))
> "/tmp/\301\203\300\204/."

Don't do that: inserting multibyte strings into a unibyte buffer
changes the representation of the characters in the string, so you get
a unibyte string.  Unibyte buffers should only ever hold encoded text
or binary data.

Why did you need to do something like that, and in what real-life use
case?




This bug report was last modified 11 years and 265 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.