Re: [R] How to replace German umlauts in strings?

From: Dieter Menne <>
Date: Thu, 10 Apr 2008 17:44:07 +0000 (UTC)

Hans-Jörg Bibiko <bibiko <at>> writes:

> On 10.04.2008, at 18:03, Hofert Marius wrote:
> > I have a file containing names of German students. These names
> > contain the characters "√§", "√∂" or "√ľ" (German umlauts). I use
> > read.table() to read the file and let's assume the table is then
> > stored in a variable called "data". The names are then contained in
> > the first column, i.e. data[,1]. Now if I simply display the variable
> > "data", I see, that "ä" is replaced by \x8a, "ö" is replaced by \x9a
> > and so forth.

This is strange. When I have a file umlaut.txt


and read it in with

umlaut = read.table("umlaut.txt", header = TRUE) umlautasis = read.table("umlaut.txt", header = TRUE, = TRUE)

I get the following in both cases:


1 √Ąserich
2 √Ėmadel
3 √úbermunsch

This is on Windows Vista. I use it every day without ever having seen nasty codings, typically with the following in latex

\usepackage[latin1]{inputenc} % For √ľ,√§

Dieter mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Thu 10 Apr 2008 - 17:48:34 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 10 Apr 2008 - 19:30:28 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive