help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Unknown character encodings in .emacs


From: Peter Dyballa
Subject: Re: Unknown character encodings in .emacs
Date: Sat, 7 Jun 2008 20:34:28 +0200


Am 07.06.2008 um 15:32 schrieb Alan E. Davis:

As an example, I have an abbreviation table that has been in my init file
for 15 years, and now reads as gibberish.


Check which encoding is used in a backup of your init file. Then open it with a prefix command: C-x RET c <the encoding> RET and then C-x C- f or e in dired-mode to open the init file. Now put into its first line:

        ;; -*- mode: Emacs-Lisp; coding: utf-8; -*-

and with a prefix command: C-x RET c utf-8 RET C-x C-s. This will make sure that the file is read into GNU Emacs in its original encoding and is saved as UTF-8 *and* will ever be re-opened in UTF-8 encoding.


The kind your abbreviation table looks like, makes it obvious that its UTF-8 file contents was opened in some 8-bit mode and again saved as UTF-8. 8-bit characters ("extended" US-ASCII) are in UTF-8 encoded as two 8-bit "characters." When you re-read them in 8-bit mode (1 char = 1 char, while in UTF-8 it would be 2 char = 1 char) and save them again as UTF-8 they become four 8-bit "characters."

--
Greetings

  Pete

We have to expect it, otherwise we would be surprised.







reply via email to

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