Edit on 2013-07-12: Users of UE v17.30 or any later or UES v11.20 or any later should prefer the scripting solution posted in topic
How to convert all files in a folder to UTF-8?
Sorry, but there is no ASCIIToUTF8 macro command (up to UE v17.20) nor a method to make the conversion for all opened files at once. Best idea I have is to open all files and use following macro:
Loop
IfNameIs ""
ExitLoop
EndIf
SaveAs ""
CloseFile
EndLoop
This macro opens the Save As dialog for every opened file. At the first file select
Format: UTF-8 or
UTF-8 - NO BOM and press twice the Return key to save the file with it's current name and overwrite the current file. For all other files you only have to press RETURN, TAB, RETURN. You can insert into the macro further commands before the SaveAs command to insert also the appropriate HTML or XML encoding information into every file.
Attention: Don't forget to set the Format in the Save As dialog back to your preferred file format or Default before saving a new file next time.
Note: The following macro will not work because with SaveAs without dialog the file is always saved in the current format of the file.
Clipboard 9
Loop
IfNameIs ""
ExitLoop
EndIf
CopyFilePath
SaveAs "^c"
CloseFile
EndLoop
ClearClipboard
Clipboard 0
The first macro above does not work anymore as explained with UltraEdit v16.00 depending on version of Windows because with v16.00 the Format option of the Save As dialog is not remembered anymore between two calls (Windows 2000 and Windows XP only, see
Format (encoding) not preset correct in Save As dialog (fixed) for details). The Format option is now always set to Default on opening of the Save As dialog.
But UE v16.00 and later have now a configuration setting at
Advanced - Configuration - Editor - New File Creation to create new files by default as UTF-8 files and therefore using this setting a macro could be used which just copies, the name of the file to a clipboard, the complete content of the file to another clipboard, close the file, opens a new file (encoded in UTF-8), paste the content from clipboard and saves the name from first clipboard.
Loop
IfNameIs ""
ExitLoop
EndIf
Clipboard 8
CopyFilePath
Clipboard 9
SelectAll
Copy
CloseFile
NewFile
Paste
Clipboard 8
SaveAs "^c"
CloseFile
EndLoop
Clipboard 8
ClearClipboard
Clipboard 9
ClearClipboard
Clipboard 0