Reading Persian Characters in R I have a csv file with characters in Persian and I cannot view them in R correctly. Also, I cannot subset based on Persian characters values. Here is a sample code:

list1 &lt;- c("x","y")
list2 &lt;- c("ب","الف")

list1 
list2 ##OK-readable

writedf &lt;- as.data.frame(cbind(list1,list2),encoding="UTF-8")
write.csv(writedf,"test.csv")
testdf &lt;- read.csv("test.csv",encoding="UTF-8")

testdf  
## not readable

testdf[,testdf$list2=="ب"]
## data frame with 0 columns and 2 rows  ???
make sure the files are saved in UTF
try Sys.setlocale("LC_ALL", locale_code) and have a look at the documentation of this function