How to export a csv in utf-8 format?

前端 未结 2 1583
滥情空心
滥情空心 2020-12-03 05:33

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

相关标签:
2条回答
  • 2020-12-03 05:51

    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.

    0 讨论(0)
  • 2020-12-03 05:56

    Try opening a UTF8 connection:

    con<-file('filename',encoding="UTF-8")
    write.csv(...,file=con,...)
    
    0 讨论(0)
提交回复
热议问题