[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
auto-recognize utf-8 encoded files upon visiting: solved (sort of...)
From: |
Gerald Wildgruber |
Subject: |
auto-recognize utf-8 encoded files upon visiting: solved (sort of...) |
Date: |
24 Sep 2002 13:45:22 +0200 |
User-agent: |
Gnus/5.090003 (Oort Gnus v0.03) Emacs/21.3.50 |
Thanks to everybody who helped answering my question!
What I was trying to do was to make emacs auto-recognize utf-8 encoded
files upon visiting. In the beginning, it didn't.
The problem seems to have been that -- latin-9 being my primary language
environment -- utf-8 only appeared at the end of my priority list for
encodings. Emacs then seems to take my utf-8 file as beeing encoded in one
of the prior coding entries of the priority list (probably as one of the
iso-2022 family). Seems to be an erroneous recognition. Letters beyond
ascii are messed up then.
I didn't want utf-8 to be on the first place of the priority list (because
then all newly cereated files then have it as their default encoding), but
neither on the last one.
If you do a double M-x prefer-coding-system, the first time with utf-8,
the second time with latin-9 as the value, utf is promoted to the second
place of the priority list, latin-9 remains on the first place.
Now without any explicit indication of the encoding (e.g. via file
variables) emacs correctly recognizes the encoding, when I'm visiting
utf-8 files.
To achieve this entry order in the priority list PERMANENTLY I simply put
the following two lines, in this order, into my init file:
(prefer-coding-system 'utf-8)
(prefer-coding-system 'latin-9)
I'm sure there is a cleaner and more elegant solution, but it kind of works.
Last remark:
Charles, thanks for your hint on TEI; I gave TEI a long try many years ago,
when SGML came up, they provided very good introductory material to the
whole issue. But I didn't know of their work on emacs. You say that the
unicode stuff didn't work right on emacs 21.2. I compiled an emacs version
from the CVS sources (http://savannah.gnu.org/projects/emacs/) and there
unicode integration seems to be already more evolved than in the official
distribution. Almost everything works very well. Perhaps you should give it
a try. I'm also working with different languages (cl.greek) and I am very
happy with the evolving unicode capabilities of emacs. I think unicode
integration is THE way by which emacs stops being merely a tool for
programmers and addresses a wider audience also in the humanities.
Gerald.
- Re: How to make emacs auto-recognize utf-8 encoded files upon visiting, (continued)
- Message not available
- Re: How to make emacs auto-recognize utf-8 encoded files upon visiting, Stefan Monnier <address@hidden>, 2002/09/27
- Re: How to make emacs auto-recognize utf-8 encoded files upon visiting, Charles Muller, 2002/09/25
- Re: How to make emacs auto-recognize utf-8 encoded files upon visiting, Charles Muller, 2002/09/25
- Re: How to make emacs auto-recognize utf-8 encoded files upon visiting, Charles Muller, 2002/09/25
- Message not available
- Re: How to make emacs auto-recognize utf-8 encoded files upon visiting, Miles Bader, 2002/09/25
- Message not available
- Re: How to make emacs auto-recognize utf-8 encoded files upon visiting, Stefan Monnier <address@hidden>, 2002/09/25
- tramp, Roger Mason, 2002/09/24
- Message not available
- Message not available
- Re: How to make emacs auto-recognize utf-8 encoded files upon visiting, A. Lucien Meyers, 2002/09/24
auto-recognize utf-8 encoded files upon visiting: solved (sort of...),
Gerald Wildgruber <=
Re: How to make emacs auto-recognize utf-8 encoded files upon visiting, Dominic Cronin, 2002/09/24