[R] Sourcing files with Umlaut in path no longer works
Duncan Murdoch
murdoch.duncan at gmail.com
Wed Nov 21 15:59:18 CET 2012
On 21/11/2012 6:49 AM, Ulrike Grömping wrote:
> Dear helpeRs,
>
> on my new machine - Windows 7 64Bit, R 2.15-2, I can no longer source
> files for which the path contains the o-Umlaut (ö). As a historical
> burden, my username is Grömping and contains that Umlaut (I wouldn't
> have chosen it now, but decided to keep it for easy transfer). I have
> had the difficulty that I couldn't use the R CMD tools on files with
> Umlauts in the path (and solved it by having a dedicated directory
> without umlaut in the path for that purpose), but so far (Windows XP and
> earlier R versions) sourcing from within R worked fine.
>
> The issue is that the o-Umlaut (ö) is always replaced by a capital A
> with tilde above together with a paragraph symbol (ö). Apparently, the
> c3b6 used for the o-Umlaut in some encoding is translated back to the
> ö. Can I somehow fix this? Or is it a bug?
>
I can't reproduce this. The file d:/temp/Grömping/test.R contains
cat("it worked!\n")
I am on Windows 7 64bit, and I see the following in both 32 and 64 bit R:
> source("d:/temp/Grömping/test.R")
it worked!
If I look at Encoding("d:/temp/Grömping/test.R") I get "latin1". If I run
iconv("d:/temp/Grömping/test.R", "latin1", "UTF-8")
I get a proper UTF-8 string, but if I run
iconv("d:/temp/Grömping/test.R", "latin1", "utf8")
I get a string with encoding marked as "unknown", and displayed as
[1] "d:/temp/Grömping/test.R"
So perhaps you or we have used an unofficial name of the UTF-8 encoding
in some conversion. We need to know exactly what you did to pursue this.
Duncan Murdoch
Duncan Murdoch
More information about the R-help
mailing list