I am trying to export a data.frame to a csv with utf-8 encoding. I have tried generating the file with write.csv with no success and the help(write.csv) did not mention any specific advice on creating that specific output. Here is my current export line.
write.csv(prod_out, file="product_output.csv",append=FALSE,eol="\r")
Any advice you can offer is appreciated.
Go to File and then Save as. At the bottom of the window you will find a dropdown list called Encoding, there select UTF-8 and press Save.
The evaluated encoding of the open file will display on the bottom bar, far right side. The encodings supported can be seen by going to Settings -> Preferences -> New Document/Default Directory and looking in the drop down.
This question is pretty old - I guess things have changed a lot since 2010. Anyway, I just came across this post and I happen to know the solution. You just add fileEncoding = "UTF-8"
option directly to write.csv
.
Try opening a UTF8 connection:
con<-file('filename',encoding="UTF-8") write.csv(...,file=con,...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With