Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 225
  • Last Modified:

Strange characters in logfile

Hi,

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
            File_Name.Close
            Set File_Name = Nothing
            Set newFS = Nothing
End Function

Open in new window

Strange-chacracters.log
logfiles.log
6.bmp
0
csharp_learner
Asked:
csharp_learner
1 Solution
 
pritamduttCommented:
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


to

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

Open in new window


0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now