[R] Problem with writing a file in UTF-8

tpklein tpklein at ma.tum.de
Thu Feb 17 22:54:53 CET 2011


Hello,

I am working with a data frame containg character strings with many special
symbols from various European languages.  When writing such character
strings to a file using the UTF-8 encoding, some of them are converted in a
strange way.  See the following example, run in R 2.12.1 on Windows 7:

out <- file( description="out.txt", open="w", encoding="UTF-8")
write( x="äöüßæűŁ", file=out )
close( con=out )

The last two symbols in the character string are converted to "uL" while all
other characters are not changed (which is what I want).  How to explain
this?  Does it have something to do with my locale?  And is there a way to
work around this problem? -- Any help would be greatly appreciated.

Thomas
-- 
View this message in context: http://r.789695.n4.nabble.com/Problem-with-writing-a-file-in-UTF-8-tp3311721p3311721.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list