Strange characters in logfile


I have a vb script code to write into the logfiles.log, but strangely when the program ran at another PC the rests of the log file is Stange_characters.log

I have print screen the results of the messagebox, so by right what should appear in the messagebox should be written into the logfile...
MsgBox strChanges
Call Write_in_File("C:\transActive\bin\SIG_schematic.txt", strChanges)

End Sub

Function Write_in_File(File, Content)
        Dim newFS
        Dim File_Name
            Set newFS = CreateObject("Scripting.FileSystemObject")
            Set File_Name = newFS.OpenTextFile(File, 8, True)
            File_Name.Write Now & " " & Content & vbCrLf
            Set File_Name = Nothing
            Set newFS = Nothing
End Function

Open in new window

Who is Participating?
It appears for some reason the log file is created using UNICODE character set

Try changing  

Set File_Name = newFS.OpenTextFile(File, 8, True)

Open in new window


 Set File_Name = newFS.OpenTextFile(File, 8, True,0)

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.