I just opened some R-Scripts I wrote on R-Studio under Windows 7 in Ubuntu and somehow all the special characters get substituted by question-marks.
Has anybody an idea why that could be and how to avoid it?Thx in advance.
I just opened some R-Scripts I wrote on R-Studio under Windows 7 in Ubuntu and somehow all the special characters get substituted by question-marks.
Has anybody an idea why that could be and how to avoid it?Thx in advance.
Ok I found it out.
In my Windows 7 distribution the system-wide default encoding was set to ISO-8859-1. R Studio saves files under Windows with the system default, as seen here. (Note that the default encoding on Windows7 might also differ from the above depending on your geographical region)
Now, R-Studio on Ubuntu opens files by default with UTF-8 which causes the described problem with special characters. So to avoid this either save the original script with UTF-8 before opening in Ubuntu...or open R-Studio on Ubuntu and go to:
-> File
-> Reopen with Encoding
and define the Encoding.
Note that therefore you will have to know the Encoding/codepage of the script which can be found out only on the original OS not by the file itself as seen here