Skip to content
Prev 386032 / 398513 Next

write.csv covert Åland to <c5>land

You don't say, but I'd guess you're using Windows.  In your code page, 
the character ? is probably not representable.  At some point in the 
sequence of operations involved in printing the dataframe R puts the 
string into the native encoding, and since that's impossible on your 
system, it substitutes the <c5> instead.  The fact that you can 
sometimes display it is because internally R uses UTF-8 as much as it 
can, and it can represent the character.

One fix for this is to switch from Windows to some other OS.  The others 
all have proper support for UTF-8.

You might have luck changing your Windows code page to one that includes 
the ?, but then there'll be some other characters that are missed.

You should definitely investigate Eberhard's advice, and test non-base 
packages like readr.  They are all written much more recently than the 
base functions, and might have proper support for out-of-code-page 
characters.

Duncan Murdoch
On 20/10/2020 8:20 a.m., Jinsong Zhao wrote: