encoding inferno german special characters
Asked Answered
B

1

8

in StatET eclipse as well as in RStudio I set

options(encoding = "ISO-8859-1")

in StatET I have:

Sys.getlocale()
[1] "LC_COLLATE=German_Germany.1252;LC_CTYPE=German_Germany.1252;LC_MONETARY=German_Germany.1252;LC_NUMERIC=C;LC_TIME=German_Germany.1252"

in RStudio the same:

Sys.getlocale()
[1] "LC_COLLATE=German_Germany.1252;LC_CTYPE=German_Germany.1252;LC_MONETARY=German_Germany.1252;LC_NUMERIC=C;LC_TIME=German_Germany.1252"

all on the same computer running at the same time, but with the same input (in both cases entered in to the console directly), I get different results.

RStudio:

strsplit("GRÜN", "")
[[1]]
[1] "G" "R" "Ü" "N"

StatET:

strsplit("GRÜN", "")
[[1]]
[1] "G" "R" "Ã" " "N"

Question: What else do I need to do besides setting Sys.setlocale() and encoding to make the two systems produce the same result?

Backwater answered 30/7, 2013 at 11:25 Comment(0)
F
0

I'm no expert on this, but if you are on Windows I suspect it is the system locale. In that case go to: control panel -> region and language -> administrative -> change system locale [for non unicode programs]

I have everything set to work with Russian on my computer, and this is no problem at all, but when I tried your code with I got this:

Sys.setlocale("LC_CTYPE","german")
strsplit("GRÜN", "")
[[1]]
[1] "G" "R" "Ь" "N"

So clearly Rstudio is confusing the umlaut and the Russian soft sign, which is something Windows often does.

Furlana answered 25/10, 2013 at 12:53 Comment(2)
Thanks for your response, doesn't really answer my question though. Since the locale options are the same for both RStudio and StatET, the difference in output must be due to something else...Backwater
sure thing =) I'd still try it though - some programs rely on Windows for displaying non-latin characters, while others don't.Furlana

© 2022 - 2024 — McMap. All rights reserved.