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 10:44:54 -0700 (PDT)

Thanks for that.  I've taken your suggestions and added the line suggested by eli in a separate email.  My .emacs looks like this now:

// being .emacs
(message "TS1971 Hello World from .emacs")

(setq locale-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(prefer-coding-system 'utf-8)

(setq-default buffer-file-coding-system 'utf-8)
// end .emacs

I also upgraded to version - GNU Emacs 24.2.1 (i386-mingw-nt5.1.2600) of 2012-08-28 on MARVIN.  Someone had earlier mentioned something about version 24.3 but 24.2 was the newest I saw on the GNU download site.  In any event, I'm hoping that these .emcas settings will solve my problems going forward. 

I'm still a bit stuck though with trying to use global search-replace to fix the files that are already hosed.  Here again is an example of the error I'm trying to fix:


¿Cuántos días se quedaron?

where I obviously want to repalce '¿' with '¿' and 'í' with 'í'. Doug suggested earlier that I learn about input methods and I've spent some time reading about them but I still don't know how to accomplish what I'm trying to do.  For instance describe-char tells me that the first character is codepoint 194.  Given that, how do I know which of the input methods I need to use to enter the character?  Also a probably related question.  I enter the group of extended characters neccesary for spanish by toggling on the MS International Keyboard layout.  So in order to enter 'é' for instance I type the sequence ''e' - that is a single quote followed by an 'e'.  This just works everywhere, including in the emacs edit buffer.  It doesn't work however in the emacs mini-buffer when I try to do search-replaces.  What's the solution here?  I suppose that it's input methods again, but again, I have no idea which input method I should be choosing. 

Can someone point me in the right direction here?

Thanks.



From: W. Greenhouse <wgreenhouse@riseup.net>
To: help-gnu-emacs@gnu.org
Sent: Tuesday, March 12, 2013 9:32 AM
Subject: Re: File Encoding Issue on Windows

Hi,

Tech Stuff <techstuff1971@yahoo.com> writes:

> Hi Peter,
>
> Thanks for taking the time to reply.  Though it was useful, I'm still
> confused about how to resolve this issue.  To be clear, when I posted
> yesterday, it was in emacs that I was seeing the extraneous
> characters, not in notepad.  However I just opened it again in
> notepad to check on the encoding and now I'm seeing the extra
> characters there as well.  So something must have changed when as
> part of trying to figure out what was going on, I saved the file in
> Emacs.  Emacs seems to be the culprit.  Is there something that I can
> put in my .emacs to tell it to save automatically in utf-8?  Or am I
> maybe still not understanding things.
>
> Thanks again.
>
> -ts1971

The following should unequivocally set utf-8 in all relevant contexts:

(setq locale-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(prefer-coding-system 'utf-8)

The above is tested by me only as far back as Emacs 23.  On an unrelated
note, however, you should consider upgrading if you possibly can;
according to http://www.gnu.org/software/emacs/#Releases the newest
Emacs 22 is nearly 5 years old already.


--
Regards,
WGG





reply via email to

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