[R-SIG-Mac] Foreign and UTF-8 on OS X

Simon Urbanek simon.urbanek at r-project.org
Wed Feb 1 15:43:09 CET 2006


Jim,

On Jan 30, 2006, at 4:16 PM, EJ Nikelski wrote:

>     In particular, when I use the foreign package to export a  
> dataframe to SPSS, the data file looks good, but the command file  
> contains a mix of ASCII and UTF-8 quotation marks. For example,  
> executing ...
> [...]
> Why am I getting a mix of UTF-8 and ASCII?

This is likely an issue with the `foreign' package. This is not Mac- 
specific, I have just checked and I get the same behavior on Linux  
(in UTF-8 locale, en_US.UTF-8 in my case).

> Is it valid to mix UTF-8 and ASCII in the same file?

Technically, yes, the resulting file is a valid UTF-8 file. I don't  
know whether SPSS supports it, though (and I cannot check that).

Cheers,
Simon



More information about the R-SIG-Mac mailing list