title: How to specify encoding while creating file?
body: <p>I am using an R script to create and append a file. But I need the file to be saved in ANSI encoding,even though some characters are in Unicode format. How to ensure ANSI encoding?</p>
  
  <pre><code> newfile='\home\user\abc.ttl'
   file.create(newfile)
   text3 &lt;- readLines('\home\user\init.ttl')
   sprintf('readlines %d',length(text3))
   for(k in 1:length(text3))
   {
    cat(text3[[k]],file=newfile,sep="\n",append=TRUE)
   }
  </code></pre>