简洁的想法

仁爱、喜乐、和平、忍耐、恩慈、良善、信实、温柔、节制

RStudio non-UTF8 Warning Message

| Comments

Rstudio 是一个不错的R语言IDE, 因为集成knitr, 使得这样一个编程IDE可以用Markdown来生成漂亮的PDF文本,甚至可以用LaTEX的语法加入公式,这样小篇幅的科技短文都可以用Markdown来写了。

我饶有兴致地安装了RStudio,结果一运行居然报了一个Warning,看来最近我的Warning不少。

1
2
3
4
5
6
7
8
9
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" 
WARNING: You're using a non-UTF8 locale, therefore only ASCII 
characters will work. 
Please read R for Mac OS X FAQ (see Help) section 9 and adjust your 
system preferences accordingly. 

解决的方法也就一句话,放在R控制台运行一下就好了:

1
system("defaults write org.R-project.R force.LANG en_US.UTF-8")

Comments