[ESS] latin-1 in windows

Rodney Sparapani rsparapa at mcw.edu
Tue Dec 9 18:48:08 CET 2008


pleydell at supagro.inra.fr wrote:
> Hi, I recently had to returned to Windows XP after 4 years of Debian (sobs). I
> have a French database with accented characters. Using Rgui / RWinEdt the
> following allows me to work correctly with the accented characters
> 
> read.table(file="myFile.txt", encoding="latin1")
> 
> however, emacs is displaying accented characters in code (e.g. "P\352cher"
> instead of "Pêcher" in my imported data) and logical arguments such as
> myData[mydata$species==Pêcher,] do not produce the desired results. I imagine
> there are two issues: first, the internal coding of the character; second,
> providing a correct display.
> 
> If I do M-x set-input-method latin-1-prefix and then try to define an object in
> R using accented character...
> 
>> pêcher==1
> Error: unexpected input in "p\201"
> 
> how might I pass this stumbling block?
> David

Hi David:

This is not an ESS or R question per se.  However, I am fascinated by
problems like these.  For example, how is the computer supposed to
know how something is encoded if we don't tell it?  It seems this only
works effortlessly for plain ASCII.  But, of course, emacs has a way! 
 From the menus, Options->Mule->Set coding systems->For I/O with 
subprocess (or C-x RETURN p) which prompts you (and my answers supplied 
that I found works with Pêcher):

Coding system for output from the process: latin-1
Coding system for input to the process: latin-1

And for your homework assignment...  How can you set this in your .emacs 
with the command set-buffer-process-coding-system?  I couldn't figure 
this part out, but I'm sure emacs has a way!  And for the emacs gurus 
out there, where does .emacs go now:  I'm guessing
%USERPROFILE%\Application Data\.emacs.d?

Rodney




More information about the ESS-help mailing list