Initial csv file is having Thai Language in some columns, i have queried the data from SQL server and save as csv-utf8 format, so csv itself having thai language, while loading in r,i set below code and done cleaning,
Sys.setlocale(locale="Thai")
data <- read.csv("data.csv",encoding = "UTF-8")
#Successfully read the data in Thai in R, after cleaning the data, for write.csv i gave
write.csv(data,"data.csv",fileEncoding = "UTF-8")
#But this is not writing back in Thai Language in csv,
#I have tried
encodeConnection <- file('data.csv', encoding = "UTF-8")
write.csv(data, file = encodeConnection)
}
#but not working
#There is no error message, csv is created, but those columns were not in thai, there are special characters like หมุนเวียนในà¸à¸´à¸ˆà¸à¸²à¸£,
# can someone help on this please, Thanks in advance