On Tue, Nov 30, 2010 at 9:09 AM, Xiaobo Gu <guxiaobo1...@gmail.com> wrote: > But locale "Chinese" will use GBK encoding by default, how to use UTF-8 > encoding > > I have tried the following, neither of them works. > > Sys.setlocale(locale = "zh_CN.UTF-8") > > Sys.setlocale(category = "LC_CTYPE", locale= "zh_CN.UTF-8") > >
Try this: > Sys.setlocale(locale = "Chinese_China") [1] "LC_COLLATE=Chinese (Simplified)_People's Republic of China.936;LC_CTYPE=Chinese (Simplified)_People's Republic of China.936;LC_MONETARY=Chinese (Simplified)_People's Republic of China.936;LC_NUMERIC=C;LC_TIME=Chinese (Simplified)_People's Republic of China.936" Although it does not specifically indicate UTF in the output if we now search for Chinese_China.936 we do find the link below which suggests that it is a UTF locale: http://docs.moodle.org/en/Table_of_locales -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.