[R] Unicode 16-bit, Lao

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Oct 23 13:36:31 CEST 2007

The question is 'why are you trying to use UCS-2 (aka Unicode) strings?' 
If it is to support characters not in the locale you are running R in, 
that cannot work as R runs in the native charset.

Please do study the posting guide: I (as the author of RODBC and of the 
internationalization features of R) have very little idea about what you 
tried.  Nor is it reasonable to expect your audience to know what 'Lao 
Script for Windows' is.  A crucial data point is what locale you used, and 
the output of sessionInfo() that we asked for 'at a minimum' would have 
supplied it.

On Tue, 23 Oct 2007, Schnitzler, Johannes wrote:
> I'm using
> R 2.6.0
> Windows XP
> Access 2003
> Lao Script for Windows 7.02
> I'm trying to use Lao with R for
> 1) Chart Legend Labels
> 2) Writing out text for HTML pages
> With Lao Script for Windows it is possible to type Unicode (16-bit).
> The strings I want to use are stored in an Access database, queried
> trough RODBC.

As what type are they stored?  My understanding is that ODBC would attempt 
to convert Unicode fields in the database to the locale in use, and this 
just indicates that the conversion failed.

There is a wide-character ('Unicode') ODBC interface on Windows but lots 
of drivers do not support it, and neither does RODBC (nor is it ever 
likely to as it would only be useful on Windows).

> The result I'm getting back are only question marks.
> I tried to type directly into the R console with the same result.

How exactly?  You should be able to 'type' characters in the current 
locale, only.

> Is there a solution for this?
> Could a conversion to UTF-8 solve this? If yes, how can the conversion
> be done?

Windows does not have UTF-8 locales, so 'no' if you are working on 
Windows.  Unfortunately the way it handles Unicode is quite distinct from 
that used by all the other R platforms, so although it would be possible 
to adapt R to work with Windows Unicode interfaces, many packages would 
also need to be rewritten and that is not a realistic prospect.

> Thank you in advance for help.
> Johannes
> 	[[alternative HTML version deleted]]
> ______________________________________________
> 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