yton Posted June 1, 2010 Share 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 Link to comment Share on other sites More sharing options...
jfcby Posted June 1, 2010 Share 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 **** Link to comment Share on other sites More sharing options...
yton Posted June 1, 2010 Author Share Posted June 1, 2010 pretty ok, but how can i hit save in auto mode when FileSaveDialog pops out? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now