[R] A question about JGR [was about encoding]

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue May 9 18:13:59 CEST 2006


On Tue, 9 May 2006, ronggui wrote:

> I use R 2.3.0 under windows.
>
>> Sys.getlocale()
> [1] "LC_COLLATE=Chinese_People's Republic of
> China.936;LC_CTYPE=Chinese_People's Republic of
> China.936;LC_MONETARY=Chinese_People's Republic of
> China.936;LC_NUMERIC=C;LC_TIME=Chinese_People's Republic of China.936"
>> localeToCharset()
> [1] "CP936"
>
> Now I want to use JGR,which uses UTF-8 encoding.
> So when I use save.image function to save something containg Chinese
> character with R,and then load into JGR, the Chinese character will
> not display correctly.Of course,I can use iconv to convert the
> character making it readable.But is there any better way to this?

Yes, use a better OS!

Otherwise, Windows has no concept of UTF-8 locales, so if JGR expects one, 
the problem is that JGR needs to do the conversions: it is R that is 
running natively and JGR which is `foreign' here.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list