[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Automatic recognition of some specific coding systems
From: |
Jürgen Hartmann |
Subject: |
RE: Automatic recognition of some specific coding systems |
Date: |
Tue, 24 Feb 2015 23:30:49 +0100 |
Thank you, Eli Zaretskii, for your speedy answer:
>> Is this conclusion correct?
>
> No, I don't think so. There's no direct relation between categories
> and recognition of encoding.
I am very glad to hear that.
> If you have specific problems, i.e. if Emacs doesn't recognize the
> encoding of some file(s), please post the details. (I'd suggest to
> try in "emacs -Q" first, because some problems might be caused by your
> customizations that need to be removed or adapted to the new version.)
> Then people here could review the problems and advise you about
> possible solutions, or ask you to file a bug report.
>
> But in general, there shouldn't be any regressions in recognizing
> encodings.
OK. I will try to give a specific example - it is rather artificial
but representative:
Consider an utf-8-unix encoded text file, meaningfully named
utf-8-unix, that just contains the seven German special characters
äöüßÄÖÜ ("a"o"u"s"A"O"U)
in one single line followed by a newline character. Now we make two
copies of this file and recode them to the other coding systems of
interest:
cp utf-8-unix latin-9-unix
recode ..l9 latin-9-unix
cp utf-8-unix cp850-dos
recode ..pc cp850-dos
Visiting all tree files in an Emacs session that was freshly started
by means of
emacs -Q
- thank you for that important hint - yields a perfect recognition of
the respective coding in the case of
utf-8-unix
latin-9-unix (recognized as latin-1-unix, equivalent here)
but the recognition fails tor the cp850-dos encoded file, as it is
recognized as
raw-text-dos
encoded and its contents is displayed as
\204\224\201\341\216\231\232
Looking on the contents of the variable coding-category-list, it has
the form
(coding-category-utf-8 coding-category-charset ...
coding-category-raw-text ...)
where the values of the variables coding-category-utf-8 and
coding-category-charset are utf-8 and iso-latin-1 respectively.
If I start again with a new Emacs session (emacs -Q), but this time
performing the commands
prefer-coding-system cp850
prefer-coding-system utf-8
prior to visiting the files, the codings of
utf-8-unix
cp850-dos
are recognized correctly, while the file latin-9-unix is recognized as
cp850-unix encoded and its contents is displayed as some cryptic symbols.
The coding-category-list and the variable coding-category-utf-8 have
the same values as before, but the variable coding-category-charset
contains cp850 this time.
So my problem is to find a configuration of Emacs 24.4 that yields a
correct automatic recognition of all tree coding systems
utf-8-unix
latin-9-unix or
cp850-dos
when the files of the example above are visited. One has to keep in
mind that this was perfectly possible with Emacs 22.3, as I just
verified again.
Sorry for the rather long post, but I hope that I could state my
problem more precisely.
Juergen
- Automatic recognition of some specific coding systems, Jürgen Hartmann, 2015/02/24
- Re: Automatic recognition of some specific coding systems, Eli Zaretskii, 2015/02/24
- RE: Automatic recognition of some specific coding systems,
Jürgen Hartmann <=
- Re: Automatic recognition of some specific coding systems, Eli Zaretskii, 2015/02/25
- RE: Automatic recognition of some specific coding systems, Jürgen Hartmann, 2015/02/25
- Re: Automatic recognition of some specific coding systems, Eli Zaretskii, 2015/02/25
- RE: Automatic recognition of some specific coding systems, Jürgen Hartmann, 2015/02/25
- Re: Automatic recognition of some specific coding systems, Eli Zaretskii, 2015/02/26
- RE: Automatic recognition of some specific coding systems, Jürgen Hartmann, 2015/02/26
- Re: Automatic recognition of some specific coding systems, Eli Zaretskii, 2015/02/28
Re: Automatic recognition of some specific coding systems, Yuri Khan, 2015/02/26