[ESS] Different results for Sys.getlocale()
Vincent Goulet
Vincent.Goulet at act.ulaval.ca
Thu Mar 18 21:12:21 CET 2010
Le mer. 17 mars à 08:36, Marc Schwartz a écrit :
> On Mar 17, 2010, at 4:03 AM, Martin Maechler wrote:
>
>>>>>>> "CZ" == Christian Zang <christian.zang at fh-weihenstephan.de>
>>>>>>> on Wed, 17 Mar 2010 08:00:39 +0100 writes:
>>
>> CZ> Dear list, I am using ESS 5.8 with Emacs 23.1 and R
>> CZ> 2.10.1 on Mac OSX 10.6 and have a problem with the
>> CZ> locale. In terminal R and GUI R everything is fine, but
>> CZ> in ESS, umlauts (like \"{u}) are not displayed properly
>> CZ> (but with a leading quotation mark like "u, which makes
>> CZ> ESS display the following text like a
>> CZ> string). Sys.locale in Terminal or GUI gets me
>> CZ> "en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8"
>> CZ> (GUI) or
>> CZ> "de_DE.UTF-8/en_US.UTF-8/C/C/de_DE.UTF-8/de_DE.UTF-8"
>> CZ> (terminal), but with ESS, I only get "C".
>>
>> ouch..
>>
>> Is this also true, when you start Emacs
>>
>> M-x shell
>> and type
>> locale
>> in that shell ?
>>
>> I expect your answer to be "yes".
>
> Yes... :-)
>
>> In that case, you need help about "Emacs on Mac OSX" (and use
>> M-x shell as example to demonstrate the problem)
>> rather than help on ESS.
>>
>> Regards,
>> Martin
>>
>> CZ> Has anyone come across that problem and could point me
>> CZ> to some solution? Thanks!
>>
>> CZ> Best, Christian
>
>
> Try putting the following in your ~/.emacs file:
>
> (setenv "LANG" "en_US.UTF-8")
>
> This will set the locale within emacs when run on OSX. Adjust as you may require for your specific locale.
>
> The problem is that vanilla GUI based emacs 23 running on OSX does not, by default, pick up the shell environment. I have to do this with my $PATH setting in order to be able to run certain shell scripts from within ESS. My recollection is that some of the other pre-packaged versions of emacs for OSX (eg. Aquamacs, Carbon Emacs) have locally added init code that does this invisibly.
Just as a shameless plug: my Emacs distribution for OS X (http://vgoulet.act.ulaval.ca/emacs/mac) also does it out of the box. Actually, I lifted the code from Aquamacs.
This distribution is getting in pretty good shape. It's the one I use every day now and I think it is pretty good for those who want to stay close to the standard GNU Emacs. It is not Mac-ified at all. Like my Windows distribution, it comes with ESS and AUCTeX loaded.
Vincent Goulet
École d'actuariat, Université Laval
>
> BTW, if you were to Google for this issue, you may see references to the use of ~/.MacOSX/environment.plist. Do not use this approach to setting environment variables, as it introduces other complications.
>
> HTH,
>
> Marc Schwartz
>
> ______________________________________________
> ESS-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
More information about the ESS-help
mailing list