all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* character encoding EMACS + WINDOWS +SHELL
@ 2010-08-10 15:48 Pablo Mercader Alcántara
  2010-08-10 17:23 ` Lennart Borgman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Pablo Mercader Alcántara @ 2010-08-10 15:48 UTC (permalink / raw
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 892 bytes --]

Because I want to explain it clear and fast I used an example (I'm on
windows XP SP2 using GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600):

1. I open notepad
2. write "coño"
3. I save "prueba.txt" and close
4. then press "Start + r"
5. and write cmd
6. type "emacs -nw" (I want to use it in the shell)
7. then in EMACS C-x C-f "prueba.txt"
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 ?...
9. I close emacs "C-x C-c"
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?? i need to express myself I'd like to do it through EMACS +
WINDOWS + SHELL :)

thanks in advance !

[-- Attachment #2: Type: text/html, Size: 1188 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: character encoding EMACS + WINDOWS +SHELL
  2010-08-10 15:48 character encoding EMACS + WINDOWS +SHELL Pablo Mercader Alcántara
@ 2010-08-10 17:23 ` Lennart Borgman
  2010-08-10 17:49 ` Eli Zaretskii
  2010-08-10 18:52 ` Peter Dyballa
  2 siblings, 0 replies; 4+ messages in thread
From: Lennart Borgman @ 2010-08-10 17:23 UTC (permalink / raw
  To: Pablo Mercader Alcántara; +Cc: help-gnu-emacs

2010/8/10 Pablo Mercader Alcántara <programingfrik@gmail.com>:
> Because I want to explain it clear and fast I used an example (I'm on
> windows XP SP2 using GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600):
>
> 1. I open notepad
> 2. write "coño"
> 3. I save "prueba.txt" and close
> 4. then press "Start + r"
> 5. and write cmd
> 6. type "emacs -nw" (I want to use it in the shell)
> 7. then in EMACS C-x C-f "prueba.txt"
> 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 ?...
> 9. I close emacs "C-x C-c"
> 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?? i need to express myself I'd like to do it through EMACS +
> WINDOWS + SHELL :)

It is a bug in the display part of Emacs. I can confirm it is there in
a trunk checkout from today. Please send a bug report.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: character encoding EMACS + WINDOWS +SHELL
  2010-08-10 15:48 character encoding EMACS + WINDOWS +SHELL Pablo Mercader Alcántara
  2010-08-10 17:23 ` Lennart Borgman
@ 2010-08-10 17:49 ` Eli Zaretskii
  2010-08-10 18:52 ` Peter Dyballa
  2 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2010-08-10 17:49 UTC (permalink / raw
  To: help-gnu-emacs

> Date: Tue, 10 Aug 2010 11:48:51 -0400
> From: Pablo Mercader Alcántara <programingfrik@gmail.com>
> 
> Because I want to explain it clear and fast I used an example (I'm on
> windows XP SP2 using GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600):
> 
> 1. I open notepad
> 2. write "coño"
> 3. I save "prueba.txt" and close
> 4. then press "Start + r"
> 5. and write cmd
> 6. type "emacs -nw" (I want to use it in the shell)
> 7. then in EMACS C-x C-f "prueba.txt"
> 8. why is that instead of "coño" I get "co±o"??,

Does it work if you type "C-x RET c latin-1 RET C-x C-f prueba.txt RET"?




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: character encoding EMACS + WINDOWS +SHELL
  2010-08-10 15:48 character encoding EMACS + WINDOWS +SHELL Pablo Mercader Alcántara
  2010-08-10 17:23 ` Lennart Borgman
  2010-08-10 17:49 ` Eli Zaretskii
@ 2010-08-10 18:52 ` Peter Dyballa
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Dyballa @ 2010-08-10 18:52 UTC (permalink / raw
  To: Pablo Mercader Alcántara; +Cc: help-gnu-emacs


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




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-10 18:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-10 15:48 character encoding EMACS + WINDOWS +SHELL Pablo Mercader Alcántara
2010-08-10 17:23 ` Lennart Borgman
2010-08-10 17:49 ` Eli Zaretskii
2010-08-10 18:52 ` Peter Dyballa

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.