#include <File.au3>
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
Func convert($file)
Local $srch = "µ∫˙√†‰∂ˇî®ßÃĀåḌḤĪïùàḶḸṂṆñìṄṚṜṢŚṬāḍḥīḷḹṃṁṇṅṛṝṣśṭūäÇéüöëò"
Local $repl = "mnhntrdtirsnaadhinhmllmnnnnrrsstadhiiimmnnrrsstuasiutnd"
Local $check = FileGetAttrib($file)
If StringInStr($check, "D") Then
ConsoleWrite("Skipping the directory " & $file & @CRLF)
Return
Else
ConsoleWrite("Parsing file: " & $file & @CRLF)
EndIf
; load file content into memory
$filereader = FileOpen($file)
$content = FileRead($filereader)
FileClose($filereader)
; change all characters in memory
For $i = 1 To StringLen($srch)
$content = StringReplace($content, StringMid($srch, $i, 1), StringMid($repl, $i, 1))
Next
; write back file to disk
$filewriter = FileOpen($file, 2)
FileWrite($filewriter, $content)
FileClose($filewriter)
EndFunc ;==>convert
; Display an open dialog to select a list of file(s).
Local $sFileOpenDialog = FileOpenDialog("Hold down Ctrl or Shift to choose multiple files.", @ScriptDir & "\", "Text (*.txt)|Au3 (*.au3)", BitOR($FD_FILEMUSTEXIST, $FD_MULTISELECT))
If @error Then Exit MsgBox($MB_SYSTEMMODAL, "", "No file(s) were selected.")
; split up the selected files into an array
$sFileOpenDialog = StringSplit($sFileOpenDialog, "|")
; walk through the array, convert one file after another
For $file = 1 To $sFileOpenDialog[0]
convert($sFileOpenDialog[$file])
Next
Fixed problem with only one file.
Now using the approach of reading the file into memory, convert the characters and writing the file back.