yton 0 Posted June 1, 2010 (edited) Greetings, i have the script that should 1) open csv file with some data in notepad (initial file encoding is ANSI) 2) save file with the same data in UTF-8 encoding $csv = (@ScriptDir & "\" & "in.csv") $hWriteHandle = FileOpen($csv, 128+2) FileSaveDialog(blablabla, $hWriteHandle) now it saves in UTF-8 but it saves an empty file well, in general i just need to switch from ANSI encoding to UTF-8 please, help Edited June 1, 2010 by yton Share this post Link to post Share on other sites
jfcby 3 Posted June 1, 2010 Try this... $csv = (@ScriptDir & "\" & "in.csv") $file_save = FileSaveDialog( "Choose a name.", @ScriptDir, "CSV files (*.csv)", 2) If @error Then MsgBox(4096,"","Save cancelled.") Else $file = FileOpen($file_save, 128+2) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, FileRead($csv)) FileClose($file) EndIf jfcby Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB **** Share this post Link to post Share on other sites
yton 0 Posted June 1, 2010 pretty ok, but how can i hit save in auto mode when FileSaveDialog pops out? Share this post Link to post Share on other sites