Here is the code showing the problem:
myPath = getwd() cat(\"abcd\", append = T, file =paste(myPath,\"temp1.html\", sep = \"\\\\\")) # This is fine cat(\"
Try it this way
cat("abcd", file = (con <- file("temp1.html", "w", encoding="UTF-8"))); close(con)