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

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

bug#15426: 24.3.50; Multibyte filenames and directory-files in unibyte b


From: Andreas Politz
Subject: bug#15426: 24.3.50; Multibyte filenames and directory-files in unibyte buffer
Date: Fri, 20 Sep 2013 22:56:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: Stefan Monnier <address@hidden>
>> Cc: Andreas Politz <address@hidden>,  address@hidden
>> 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







reply via email to

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