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

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

Re: [h-e-w] Displaying Latin characters


From: John J. Xenakis
Subject: Re: [h-e-w] Displaying Latin characters
Date: Mon, 4 Jan 2010 11:52:38 -0500

Dear Eli,

>   Nothing should be needed.  It should happen by default.

>   That Emacs in your case displays \351 is an indication that Emacs
>   thinks this is a raw binary byte, not a Latin-1 character.  So
>   please tell how did you get that character in your buffer.  If you
>   can reproduce this at will, please start with "emacs -Q" and
>   describe here all the steps needed to reproduce this.

The simple answer to this question is that I simply load the file
using "C-x C-f".  I happen to have a file called "ascii.txt" (created
in the 1980s, actually) that contains a matrix of all ascii
characters, and emacs displays all the 8-bit characters in octal.
(Incidentally, for what it's worth, low-order characters display as
"^A", "^B", etc., and 127 displays as "^?".)

After receiving your message, I tried a few experiments.  The
experiments all worked the same with or without "-Q".

(*) I tried creating a NEW FILE.  I used "C-q 3 5 1" to insert
    "é", and it displayed correctly (i.e., as "é").  I did a hex dump
    of the file, and the character is x'e9', which is correct.  I
    restarted emacs and reloaded the file, and it displayed
    correctly.

    In other words, if the file is created by emacs, then it works
    correctly.

(*) I tried editing an EXISTING FILE.  I used "C-q 3 5 1" to
    insert "é", and it displayed correctly(!).

    HOWEVER, I did a hex dump of the file, and the character was
    stored as x'c3a9'.  I don't know what this is, but I assume that
    it's the UTF-8 representation of the character.

    I restarted emacs, and the character displays as "\305\231",
    whereas it had displayed correctly when I first typed it.  (This
    is actually doubly weird, since x'c3a9' in octal should be
    "\303\251".)

My conclusion is that there's something weird going on for existing
files.  (By "existing files," I mean files created in the past, as
well as files created in the present by a Perl program or by my old
editor CodeWright 3.1, which I still use.)

Apparently, emacs treats ascii files created by other programs
differently. I know that this doesn't make sense, since ascii is
ascii, but emacs must be performing some test on existing files that
makes it decide that it's not an ascii file.

So I guess that my question now is: How do I tell emacs to treat
ascii files created by other programs the same as it treats files
created by emacs?

Incidentally, I'm running 
    GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600)
      of 2009-07-30 on SOFT-MJASON

on Windows XT.

Thanks.

John






reply via email to

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