all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Peter Dyballa <Peter_Dyballa@Web.DE>
Cc: help-gnu-emacs@gnu.org
Subject: Re: UTF-8 in path / filename
Date: Fri, 25 Aug 2006 14:08:11 +0200	[thread overview]
Message-ID: <D14CA040-5F0F-4848-ACAC-CAD001A65FB7@Web.DE> (raw)
In-Reply-To: <pan.2006.08.24.13.52.22.269432@free.fr>


Am 24.08.2006 um 15:59 schrieb Grégory SCHMITT:

> Hi everyone,
>
> I'm running emacs 21.4.1 using Linux (Fedora Core 5). When I try to  
> open a
> file and the path name contains UTF-8 letters, emacs won't be able  
> to find
> the file.
>
> I create a folder called "Grégory". I put any file in it (let's  
> call it
> "test") and if I, from a simple xterm, try to do "emacs Grégory/test",
> emacs won't be able to open the file. However, it will be  
> successful if I
> manually visit using C-x C-f.
>
> If I use any other editor (such as mcedit), it will open OK.
>
> Any explanation ?
>

Yes: your terminal emulation/shell swallows/hides information.

On Mac OS X in Apple's Terminal (TERM is xterm-color) I can see UTF-8  
filenames, for example äöüßÜÖÄ€. File name expansion/completion  
does *not* work on them (although RGB äöüæÆÜÖÄ.txt gets  
expanded to RGB a?^?o?^?u?^?æ?^?U?^?O?^?A?^?.txt). And of course it  
does not work to invoke GNU Emacs with this file name as argument (or  
'built-in' vi, nano. It *works* though when I do that from the  
*shell* buffer in Unicode Emacs 23.0.0 or GNU Emacs 22.0.50 ...  
(although no file name completion and the latter showing the ¨ as  
empty boxes in the file name) If I for example paste a name with  
UTF-8 contents from ls output to pass it to vi (it gives the best  
complaints) I can see that the de-composed UTF-8 characters are  
strangely interpreted. An ä seems to vanish and become kind of  
control character, the ¨ component of A¨, i.e. Ä, is passed as <cc>  
or such ...

Since in your case mcedit accepts the file name, mcedit and your  
terminal seem to use the same character encoding, so for both é *is*  
an é. GNU Emacs lives in its own world of almost indefinite character  
encodings. One way to make Emacs work correctly is to set environment  
variables like LC_All, LANG, or LC_CTYPE which obviously just repeat  
what your shell and your OS' standard utilities know. Next is *not*  
to set current-language-environment! From LC_CTYPE etc. Emacs learns  
what encodings to set for buffer contents, file names, process data.  
If it makes mistakes in this you might consider to use

	(prefer-coding-system           'iso-latin-9-unix)	; the one with €

or a few such statements with different codings each. GNU Emacs will  
then try to apply these encodings first. Since you're working with a  
non-Unicode Emacs you might need to set

	(unify-8859-on-decoding-mode t)
	(unify-8859-on-encoding-mode t)

to make the 8 bit ISO Latin encodings be handled as quite the same,  
i.e. é would be in any of these encodings in which it exists the  
same, i.e. you could search for it in all buffers and you only once  
told isearch to look for é.


One important thing is that *you* already messed up your .emacs file.  
Try to launch it also with --no-init-file and/or --no-site-file and  
also with -nw, i.e. running inside the terminal without X windows.

--
Greetings

   Pete

The most exciting phrase to hear in science, the one that heralds new  
discoveries, is not "Eureka!" (I found it!) but "That's funny..."
                                       Isaac Asimov

  parent reply	other threads:[~2006-08-25 12:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-24 13:59 UTF-8 in path / filename Grégory SCHMITT
2006-08-24 14:42 ` Noah Slater
2006-08-25 12:08 ` Peter Dyballa [this message]
     [not found] ` <mailman.5606.1156507702.9609.help-gnu-emacs@gnu.org>
2006-08-25 13:42   ` Grégory SCHMITT
2006-08-25 18:35     ` Peter Dyballa
2006-08-25 22:06       ` Grégory SCHMITT
2006-08-25 22:55         ` Peter Dyballa
     [not found]         ` <mailman.5656.1156546542.9609.help-gnu-emacs@gnu.org>
2006-08-25 23:06           ` Grégory SCHMITT
2006-08-25 23:09           ` Miles Bader
2006-08-26  9:36             ` Peter Dyballa
2006-08-26 22:13               ` James Cloos
2006-08-27 13:12                 ` Peter Dyballa
2006-08-28 15:11                   ` James Cloos
2006-08-28 15:55                     ` Peter Dyballa
     [not found]               ` <mailman.5694.1156630455.9609.help-gnu-emacs@gnu.org>
2006-08-27  8:46                 ` Harald Hanche-Olsen
     [not found]           ` <mailman.5657.1156547377.9609.help-gnu-emacs@gnu.org>
2006-08-25 23:22             ` Grégory SCHMITT
2006-08-25 23:25               ` Miles Bader

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D14CA040-5F0F-4848-ACAC-CAD001A65FB7@Web.DE \
    --to=peter_dyballa@web.de \
    --cc=help-gnu-emacs@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.