Let's consider this simple creation of a csv file with a dataframe that contains special characters:
d <- data.frame(x = "Édifice", y="Arrêt")
write.table(x = d, file = "test.csv", sep = ",", row.names = F, col.names = F, quote = F, fileEncoding = "UTF-8")
The csv file looks like expected
Édifice,Arrêt
But when I open this csv in excel I get:
I have tried using readr, collapsing columns and then writing them with writeLines, writing using write.xlsx, checked for encoding options. None worked.
My constraint is that the input is a dataframe, and the output must be a csv readable in excel.