I'm on OSX Yosemite running Emacs 24.5 and R 3.2
I have this in my ~/.bash_profile:
export LANG=en_US.UTF-8
export LANGUAGE=en_US:en
export LC_CTYPE="en_US.UTF-8"
export LC_NUMERIC="en_US.UTF-8"
export LC_TIME="en_US.UTF-8"
export LC_COLLATE="en_US.UTF-8"
export LC_MONETARY="en_US.UTF-8"
export LC_MESSAGES="en_US.UTF-8"
export LC_PAPER="en_US.UTF-8"
export LC_NAME="en_US.UTF-8"
export LC_ADDRESS="en_US.UTF-8"
export LC_TELEPHONE="en_US.UTF-8"
export LC_MEASUREMENT="en_US.UTF-8"
export LC_IDENTIFICATION="en_US.UTF-8"
export LC_ALL=en_US.UTF-8
this in my emacs settings:
(setq current-language-environment "UTF-8")
(add-hook 'ess-R-post-run-hook
(lambda () (set-buffer-process-coding-system
'utf-8-nfd-unix 'utf-8-nfd-unix)))
And I've even set the following system-wide:
defaults write org.R-project.R force.LANG en_US.UTF-8
When I run R from the command line or in RStudio, it uses the correct locale. When I run an R process in emacs though, I get the following warning:
During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C"
2: Setting LC_COLLATE failed, using "C"
3: Setting LC_TIME failed, using "C"
4: Setting LC_MESSAGES failed, using "C"
5: Setting LC_MONETARY failed, using "C"
And any non-ASCII characters are malformed producing errors. How can I set the correct locale?