[R] UTF-8 or Unicode on Windows PC

Hans-Joerg Bibiko bibiko at eva.mpg.de
Mon Apr 21 10:40:08 CEST 2008


Dear all,

is it possible to set up RGUI or JGR on Windows PC to UTF-8 encoding?

I looked for it in mailing lists and in the documentation, but I  
couldn't figure out it.

My problem is e.g. to split a given string containing German and  
Russian words into characters.
example:

 > a <- "asdШas"
 > strsplit(a,NULL)
[[1]]
[1] "a" "s" "d" "Ш" "a" "s"

works on each Mac or Linux computer, but I didn't find a way for  
Windows.

I tried to set options(encoding) to UTF-8, I tried to use the Perl  
mode in strsplit, but I had no success. At least by using JGR I was  
able to type Russian and see my text correctly but strsplit failed.

I set RGUI to a Unicode font, no success.

I tried to save a script file in UTF-8 or UTF-16 and I tried to run  
source(FILE, encoding="***"), no success.

Is there really no way to use a Windows PC and R to work with Unicode  
texts?

Many thanks in advance for each hint,

--Hans


More information about the R-help mailing list