[R-SIG-Mac] [R] data frames with å, ä, and ö (=non-ASCII-characters) from windows to mac os x
Prof Brian Ripley
ripley at stats.ox.ac.uk
Fri Jan 16 15:16:09 CET 2009
On Fri, 16 Jan 2009, David Winsemius wrote:
>
> On Jan 16, 2009, at 8:48 AM, Prof Brian Ripley wrote:
>
>> You need to use CP1252 not UTF-8 to read the data. It tells you how to do
>> so on the help page ... under 'encoding'. So something like
>>
>> A <- read.table(con <- file("myfile", encoding="CP1252"));close(con)
>>
>> Please don't cross-post ... I am being brief because you did.
>
>
>> snip
>
>
> Realizing that it might not work in all situations, would it give (possibly)
> useful results to assign the incorrect encoding found in Gustaf's email,
> which nonetheless was interpreted sensibly, "iso-8859-1", to the encoding
> string?
Yes: CP1252 is a superset of ISO-8859-1. I knew because only one
encoding can be used for Swedish on Windows (unlike most other OSes
where there are three -- see my second posting).
--
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-SIG-Mac
mailing list