Mailing List Archive


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

Re: [tlug] Emacs IME, locale, encodings, R, aarrrrgggghhhh!!!!



On Sun, 2021-03-07 at 12:48 +0000, Darren Cook wrote:
> That looks like the key difference to zoom in on, doesn't it. R can
> see them as UTF-8 strings in batch mode, but not when it is a child
> process of emacs. Can you print the env variables, from within the R
> script, to see if they are any different when in the child process?

Thanks for the help, Darren. This seems to be near what's happening. I
ran R in a terminal, and copied and pasted the code from my open emacs
window and got the same thing. Then I tried running R in a new
terminal, and copied and pasted from the program *displayed in another
terminal*. This time I got this:

> print(house.names)
[1]
"name"               "å¹³å±\u008b"               "ã\u0081©ã\u0081\u0093
ã\u0081\u008bã\u0081®ã\u0083\u009eã\u0083³ã\u0082·ã\u0083§ã\u0083³"
[4]
"湯河å\u008e\u009fã\u0083\u009eã\u0083³ã\u0082·ã\u0083§ã\u0083³"   "ç
\u0086±æµ·ã\u0083\u009eã\u0083³ã\u0082·ã\u0083§ã\u0083³"    
> print(Encoding(house.names))
[1] "unknown" "UTF-8"   "UTF-8"   "UTF-8"   "UTF-8"  

and the graph printed out with the labels in Japanese. For some reason,
emacs is messing with the encoding and the handling of the Japanese
strings. 

Also, it doesn't seem to matter what system locale is being used. It
seems to work as well (or as badly) if I set it to en_US.UTF-8 or to
ja_JP.UTF-8.

-- 
Stuart Luppescu
Chief Psychometrician (ret.)
UChicago Consortium on School Research
http://consortium.uchicago.edu




Home | Main Index | Thread Index