Encoding of German umlauts when using readOGR
Julian is right.
file_name <- "../gis_data/bw/AX_KommunalesGebiet.shp"shape_kommunal <- readOGR(file_name, layer = "AX_KommunalesGebiet", use_iconv = TRUE, encoding = "UTF-8")data_kommunal <- shape_kommunal@datahead(data_kommunal)
returns the string correctly:
GKZ NAME0 08236074 Kämpfelbach1 08425052 Grundsheim2 08435067 Deggenhausertal
I'm not quite sure what encoding = "UTF-8/LATIN-1/..."
might do. I would have expected that you would choose one and only one encoding scheme. On my machine I do see the translation of that octal character to the o-umlaut:
> 'B\303\266blingen'[1] "Böblingen"> 'L\303\266rrach'[1] "Lörrach"
To see the various conventions for R characters, type:
?Quotes
Besides encodings, there is also the need to have characters in the font being used. The font used in your console display doesn't seem to have the proper mappings for o-umlaut. My default font is Courier. You should also check your locale settings. ?Sys.getlocale