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


Message #23 received at 15426 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Politz <politza <at> hochschule-trier.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 15426 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#15426: 24.3.50;
 Multibyte filenames and directory-files in unibyte buffer
Date: Fri, 20 Sep 2013 22:56:22 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
>> Cc: Andreas Politz <politza <at> hochschule-trier.de>,  15426 <at> debbugs.gnu.org
>> Date: Fri, 20 Sep 2013 15:15:44 -0400
>> 
>> > 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.
>> 
>> AFAICT his recipe does not involve inserting any string anywhere.
>
> Perhaps the recipe should be described in more detail, then.


Here is another recipe, maybe more to the point:

-------------------->8-------------------------------------
;; -*- coding: binary -*-

(let ((d "/tmp/\303\204")) ;; utf-8 for german umlaut "A 
  (when (file-exists-p d)
    (delete-directory d t))
  (make-directory d)
  (append
   (list (car (directory-files d t)) 
         (file-exists-p (car (directory-files d t))))
   ;; switch to a multibyte buffer
   (with-temp-buffer
     (list (car (directory-files d t))
	   (file-exists-p (car (directory-files d t)))))))
--------------------8<-------------------------------------

If I save this somewhere (/tmp/foo.el), do

$ LC_ALL=C emacs -Q /tmp/foo.el

and evaluate it with C-x C-e, the minibuffer displays

=> ("/tmp/\301\203\300\204/." nil "/tmp/\303\204/." t)
 
.

I hope that clarifies it.

-ap






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

Previous Next


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