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

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

Re: File Encoding Issue on Windows


From: Tech Stuff
Subject: Re: File Encoding Issue on Windows
Date: Wed, 13 Mar 2013 16:26:39 -0700 (PDT)

Hi Again,

I believe that the bytes on disk *have* changed.  There is no other way to explain that the text used to display correctly in notepad and now doesn't.  In notepad I see the same extraneous / incorrect characters that I see in Emacs.  So I think that I have a correctly utf-8 encoded file which contains some characters that I don't want.  Is there really no way to use global search and replace to replace these codepoints?

-jason



From: Peter Dyballa <Peter_Dyballa@Web.DE>
To: Tech Stuff <techstuff1971@yahoo.com>
Cc: W. Greenhouse <wgreenhouse@riseup.net>; "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Sent: Wednesday, March 13, 2013 3:16 PM
Subject: Re: File Encoding Issue on Windows


Am 13.03.2013 um 22:11 schrieb Tech Stuff:

> apparently I saved the files with the wrong encoding.  So now I think that I really have those incorrect characters.

Why? Before your failure the file had 31 bytes contents. In some code page this represents 31 characters, in UTF-8 this represents 29 characters.

When you save a text in UTF-8 encoding in some 8-bit code page *and* *you* *do* *not* *change* *one* *single* *byte* then the file's contents is not changed (because GNU Emacs does not change a single byte). What's changed, for the application that displays this file's contents, is the perspective. Example: as a child on four extremities you could only see from aside the green of a carrot. As a grown-up you can look down on the same green (and know that something with a different colour is below the surface). And when you're dead you'll see what the other colour is.

Same bytes, different perspectives, different (re)presentations for you.

Or consider a series of bit and bytes in a computer's memory. Some computers read the same sequence  and interpret the first eight bits as the Most Significant Byte, others assume it's the Least Significant Byte, one sees that your bank account has a credit, the other sees the debit.

So just try to "switch" through some encodings! And don't forget to watch the mode-line: Does it signal a modified file while switching? And: Does it work to save an unmodified file? (What has this to do with encodings?!)

--
Greetings

  Pete

The day Microsoft makes something that doesn't suck is the day they start selling vacuum cleaners.
                – Ernest Jan Plugge




reply via email to

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