[R] write.foreign, SPSS on Mac OS X

Thomas Lumley tlumley at u.washington.edu
Wed Jul 13 18:59:53 CEST 2005

On Wed, 13 Jul 2005, EJ Nikelski wrote:
> Your suggestion that the unprintable characters represent UTF-8 encoded
> Unicode left and right double quotes also appears correct. Now, although
> the suggested work-around may well help, the foreign package does seem
> to be creating a corrupted file. That is, an entirely 8-bit ASCII file
> containing embedded UTF-8 double quotes is not valid by any standard --
> and is thus unreadable by any editor on any platform. Perhaps I should
> look into filing a bug report on this to the foreign package maintainer.

It is a bug and has been fixed, but this isn't the reason. It's a bug 
because the format is wrong for SPSS.  The file is perfectly valid UTF-8: 
all the characters other than the double quotes are 7-bit ASCII and so 
have the same representation in UTF-8.


More information about the R-help mailing list