emacs and ASCII file to ISO-8859-* to UTF-8
On Tue, Nov 14, 2006 at 09:31:25AM +0100, Matus UHLAR - fantomas wrote:
> > > On 12.11.06 14:52, Andrea Ganduglia wrote:
> > > > Hi. I have a lots ascii file with ecoding iso-8859-* and I must
> > > > convert those in UTF-8. How?
>
> > On Mon, Nov 13, 2006 at 10:06:44AM +0100, Matus UHLAR - fantomas wrote:
> > > iconv -f <src-encoding> -t <dst-encoding> <inputfile> > outputfile.
> > >
> > > There is also 'recode' package, however I found it a bit redundant, since
> > > iconv (part of libc6) has this functionality
>
> On 13.11.06 09:14, hendrik@topoi.pooq.com wrote:
> > And after you've has converted such a file, how can you tell emacs that
> > it is supposed to recognise the new encoding?
>
> pardon?
This is an emacs-specific add-on question. If it has seen a file in one
encoding system, and I run a program to change it to another (in my
case, getting my accented letters converted from the old 8-bit encoding
into UTF-8) emacs insists on continuing to read it as if it were in the
old encoding, so my accented characters, which have been expanded into
two bytes each, show up in the editor as two gibberish characters each.
It seems that emacs keeps a database somewhere of file names and
encodings. In theory that would be useful, I guess, because there isn't
another mechanism in the filesysten to mark files with their encodings,
but if such a convention isn't a system-wide convention, tools don't
know about it and it doesn't work. I'm tryin to run a clean UTF-8
system, and I want my non-UTF-8 abberations to be converted and treated
as UTF-8 henceforth, instead of converting them and having them treated
as non-UTF-8.
-- hendrik
Reply to: