[R] UTF-8 or Unicode on Windows PC

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Apr 21 11:33:22 CEST 2008

You didn't tell us your R version (or your locale).  Windows has no UTF-8 
locales, so a lot of work has had to be done to allow Unicode chars to be 
handled on Windows.

Please look into 2.7.0 RC, and in particular its CHANGES file at


On Mon, 21 Apr 2008, Hans-Joerg Bibiko wrote:

> 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
> ______________________________________________
> R-help at 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.

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