Elmahy
Elmahy

Reputation: 402

How can i export a csv containing arabic letters?

I want to export a dataframe to arabic language, I tried a solution here but it didn't work as my output seems different.here is a sample code:

k<-c("أحمد","محمد","محمود")
write.csv(k,"kk.csv",fileEncoding="utf8")

output is like this

"","x" "1","<U+0623><U+062D><U+0645><U+062F>"

And then with unknown cause -when i tried the example again- it became :

"","x" "1","ÃÍãÏ"

Also R was viewing arabic letters correctly in the console but just after i tried the example is now view arabic letters like this "ÃÍãÏ" What's wrong with me?

Upvotes: 2

Views: 1240

Answers (1)

vincentmajor
vincentmajor

Reputation: 1106

Refer to this example where it may be R that cannot identify the characters but once the .csv is written it can be opened in a different software and viewed correctly.

Upvotes: 1

Related Questions