[Top][All Lists]

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

Re: how to change file coding system

From: Peter Dyballa
Subject: Re: how to change file coding system
Date: Wed, 17 Aug 2005 21:09:20 +0200

Am 17.08.2005 um 11:20 schrieb Martin Monsorno:

7) file bla*
 bla.changed-by-eclipse: UTF-8 Unicode text
 bla.created-by-eclipse: UTF-8 Unicode text
 bla.created-by-emacs:   ISO-8859 text
8) Visiting bla.changed-by-eclipse with emacs shows "�berfall"
9) Visiting bla.chreated-by-eclipse with emacs shows "überfall"

So we now have 3 files containing the "same" string, 2 of them claim
to be utf-8, but they use a different encoding (2 or 3 bytes).  For
all 3 files, when opening the in emacs, buffer-file-coding-system's
value is raw-text-unix.

I wouldn't say the files claim to be something -- it's the `file´ programme that says so, according to some rules in `magic´ files. UTF-8 contents usually cannot be distinguished from other contents -- a byte is a byte is a byte. Some UTF-8 files contain a marker by which one can determine, that it's UTF-8. Other markers state that the text is written right to left with a citation left to right. Could be Eclipse writes such a marker ...

The C-x RET commands *do not* change a buffer's (or a file's) contents,
they just put some new skin on the buffer so that your view on the
buffer's (i.e. file's) contents is adapted in a certain way: you can
see a buffer's (or file's) whatever contents in green, blue, red,
yellow, cyan ... utf-8, Mac-Roman, NeXT, koi-r8, euc-jp-unix ...

I think I understood this.  But this means that I can change the
file-encoding of a file with emacs, doesn't it?

Yes. I Usually revert buffer from file with new encoding, C-x RET r <encoding> RET and save the file in that encoding. I'd say it works reliably!

What I cite in my mails are the strings as emacs shows them to me when
loading one of the files.  So the question is, /why/ are they not
UTF-8?  Does eclipse do a wrong latin-1 to utf-8 conversion?

I don't know and use Eclipse. Test is with its own documentation -- and some reliably encoded files!

Mit friedvollen Grüßen


"engineer: a mechanism for converting caffeine into designs"

reply via email to

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