[Top][All Lists]

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

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

From: Eli Zaretskii
Subject: Re: [h-e-w] Displaying Latin characters
Date: Mon, 04 Jan 2010 20:23:33 +0200

> Date: Mon, 4 Jan 2010 11:52:38 -0500
> From: "John J. Xenakis" <address@hidden>
> Cc: address@hidden
> >   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.

Probably because having all 256 single-byte codes does not fit any
text encoding known to Emacs, so it (correctly) assumes that the file
contains raw bytes, not readable text.

Why do you care that this file is displayed as octal escapes?  It's
not that you have any readable text there.

> (*) 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".)

What encoding was that file in originally?  What does Emacs display in
the left edge of the mode line?

> My conclusion is that there's something weird going on for existing
> files.

More accurately, something weird is going on for _your_ existing
files.  I suspect that, being edited by CodeWright, they, too, include
random 8-bit bytes that don't fir with any known encoding, or at least
not with encodings Emacs tries in your environment.

> 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?

Your conclusion is wrong, so you are asking a wrong question, for
which there's no answer.

Let me begin by asking you what codepage was used (by CodeWright, I
presume) for characters whose 8th bit is set, i.e. for characters
whose codes are above 127 decimal?  If it was codepage 850, you could
try "C-x RET c cp850 RET C-x C-f" to visit the file and tell Emacs to
decode it as codepage 850.  Or maybe you should try codepage 437.
(All these are guesses; if you tell me in what locale you set up your
machine, I may guess better.)

reply via email to

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