Skip to content
Prev 3042 / 15075 Next

A bug in the Mac GUI and a request

Ivan,
On Sep 28, 2006, at 10:04 AM, Ivan Alves wrote:

            
Ok, we'll have a look. There are issues with Cocoa since 10.4 that  
are still plaguing us ...
The problem here is that your are *not* using UTF-8. UTF-8 encoding  
of "?" is (if printed as octal codes) "\303\261". So what you see is  
something that is in a different encoding - AFAIC it is latin1 as you  
can see easily:

In command-line R (without locale):
 > iconv("Compa\361ia","latin1","UTF-8")
[1] "Compa\303\261ia"

In the GUI:
 > iconv("Compa\361ia","latin1","UTF-8")
[1] "Compa?ia"

So when you are loading your table, you should be using something like
read.table(file("my.table",encoding="latin1"))
to get the correct result.

You may want to read Brian Ripley's article about encodings and  
localization in the R News Vol 5/1.

Cheers,
Simon