I have a script that reads from a log file some text with especial characters . The log file is created by other program in a UTF-8 format.
This is my script:
If iExitCode <> 0 Then
Dim objFS, objFil, sLine, DoRead
oMsg.HTMLBody = oMsg.HTMLBody & "<br><br>" & "Erro(s) e/ou Aviso(s)" & "<br>" & "____________________________"
If DoDebug Then WScript.Echo "Scanning Log File"
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFil = objFS.OpenTextFile(sLogFile, 1) ' OPEN LOG FILE FOR READING
DoRead = True
Do Until objFil.AtEndOfStream
If DoRead Then sLine = objFil.ReadLine
DoRead = True
If DoDebug Then WScript.Echo "Readline1 = " & sLine
If InStr(sLine, sLogFileError ) > 0 _
Or InStr(sLine, sLogFileWarning ) > 0 _
Or InStr(sLine, sLogFileSeriousError) > 0 Then
If ( InStr(sLine, sLogFileError ) > 0 And IncludeErrorsInReport ) _
Or ( InStr(sLine, sLogFileWarning ) > 0 And IncludeWarningsInReport ) _
Or ( InStr(sLine, sLogFileSeriousError) > 0 And IncludeErrorsInReport ) Then
oMsg.HTMLBody = oMsg.HTMLBody & "<br><br>" & sLine
End If
If Not objFil.AtEndOfStream Then
sLine = objFil.ReadLine
If DoDebug Then WScript.Echo "Readline2 = " & sLine
Do Until objFil.AtEndOfStream Or Left(sLine,1) = "["
oMsg.HTMLBody = oMsg.HTMLBody & "<br>" & sLine
sLine = objFil.ReadLine
If DoDebug Then WScript.Echo "Readline3 = " & sLine
Loop
DoRead = False
End If
End If
Loop
objFil.Close
End If
The file read output is something like this "Não é possìvel" instand of "Não é possível"
Any help?