[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: character encoding EMACS + WINDOWS +SHELL
From: |
Peter Dyballa |
Subject: |
Re: character encoding EMACS + WINDOWS +SHELL |
Date: |
Tue, 10 Aug 2010 20:52:58 +0200 |
Am 10.08.2010 um 17:48 schrieb Pablo Mercader Alcántara:
8. why is that instead of "coño" I get "co±o"??, I read the manual
already
(the powerful emac's manual) encoding, decoding, "International
Character
Support page 186 and i still don't get it, I think is related to the
windows
shell encoding ?...
Which is the encoding that Notepad uses for saving the file? Imagine
Notepad saves the file in codepage 437. The word coño will consist of
these four bytes:
63·6F·A4·6F
In code page 850 and 858 it will be the same, but in codepage 1252 it
will be:
63·6F·F1·6F
The F1 byte is in code pages 437, 850, and 858 the PLUS-MINUS SIGN
±... (the other two bytes don't change their meaning, they stay c or o
resp.)
So we can explain what is presented to you that Notepad presumingly
saves the file in CP1252 and GNU Emacs opens it in CP858 or such. The
byte F1, formerly presented to you as ñ is now, according to the new
encoding use to interpret the byte values, is now presented to you as ±.
In GNU Emacs you have the option to open the Options menu, go to Mule
(Multilingual Environment) and traverse into Set Coding Systems and
then either choose "For Next Command (C-x RET c)" to open the file in
the encoding you now input in mini-buffer or, when you have the file
already open, choose "For Reverting This File Now (C-x RET r)" and
input the new encoding. GNU Emacs will present you the file's bytes
according to this new encoding.
10 I type "EDIT.COM prueba.txt", puff ! the same "co±o", ..., is
there some
way to fix this? to display the right character "ñ"? (I'm sure there
is some
way!) how??
See the documentation of environment variables. In UNIX, GNU Emacs
understands LC_CTYPE and LANG. In Elisp you can set instead:
(prefer-coding-system 'windows-1252)
--
Greetings
Pete
Well done is better than well said.
– Benjamin Franklin