go to post Bhupinder Singh · Nov 19, 2018 Thanks for the suggestion, File is now getting converted into ANSI encoded format but now I am not able to copy file from one directory to another.When I used CopyFile method It started working but without the below mentioned line in code snippet no file is getting created. Because of this two files are getting created. Please have a look and suggest.Set tOK=##Class(%File).CopyFile(tFileName,tErrorFileName)Code Snippet()Set tFileName = tFullFilename$$$TRACE("tFileName [" _ tFileName _ "]") Set tErrorFileName = ##class(Ens.Util.File).fixPath(..Adapter.ErrorPath) _ ##class(Ens.Util.File).CreateTimestamp(##class(%File).GetFilename(tFileName));Set tErrorFileName1 = ##class(Ens.Util.File).fixPath(..Adapter.ErrorPath) _ ##class(Ens.Util.File).CreateTimestamp(##class(%File).GetFilename(tErrorFileName))$$$TRACE("tErrorFileName [" _ tErrorFileName1 _ "]") Set tOK=##Class(%File).CopyFile(tFileName,tErrorFileName)$$$TRACE("ErrorFile "_tErrorFileName_" written");Code2 Start Here===============================================================Set tReadStatus = "" Set eol = 0Set (tRecord1,tRecord) = ""Set stream=##class(%Stream.FileCharacter).%New()Set sc=stream.LinkToFile(tErrorFileName)Do stream.TranslateTableSet("UTF8")Set tNewStream = ##class(%Stream.FileCharacter).%New()Set tNewStream.Filename=tErrorFileName1Do tNewStream.TranslateTableSet("cp1252")While ('stream.AtEndGet()){ Set tRecord=stream.ReadLine(,.tReadStatus,.eol)$$$TRACE("Record1 :"_tRecord)Do tNewStream.WriteLine(tRecord)} ;Set tStatus =tNewStream.CopyFrom(stream)Set tStatus=tNewStream.%Save()Quit:('tStatus)