After 1 day searching the internet, I solved the problem with the following code:

Encode(xml) <- "UTF-8"
# now the ü etc. become ü,etc.
gsub("ü","Ä",xml) # employ the gsub()-function WITHOUT useBytes-option turned on
Encode(xml) <- "unknwon"
# that was the former encoding

So all in all there is a way of re-encode a character-string to UTF-8, the Encode() function. The above produces a valid xml-string and - if I sink it out - a valid xml-file.
Thanks for your help!

Greetings,

Tom

Quoting Uwe Ligges <lig...@statistik.tu-dortmund.de>:

R is not able to re-encode the file to the native encoding. But if you
keep it in UTF-8, what is the problem to grep for the specific
characters (as grep and friends support the argument useBytes these
days)?

Best,
Uwe Ligges


______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to