Hi,
Are there any drawbacks to opening up a file as Unicode (UTF-16) when it comes in and save it as UTF-8 with the FSO? Would it cause any conversion issues?
Thanks.
Swi
Are there any drawbacks to opening up a file as Unicode (UTF-16) when it comes in and save it as UTF-8 with the FSO? Would it cause any conversion issues?
Thanks.
Code:
Set InStream = fso.OpenTextFile(ProcessFolder & U_pageflexDataFile, ForReading)
intAsc1Chr = Asc(InStream.Read(1))
intAsc2Chr = Asc(InStream.Read(1))
InStream.Close
If intAsc1Chr = 255 And intAsc2Chr = 254 Then
OpenAsUnicode = True
Else
OpenAsUnicode = False
End If
If OpenAsUnicode = True Then
Set OutStream = fso.CreateTextFile("C:\Swiler\D-AetMMS_9-00131896_00001-rev.csv", True, False)
Set InStream = fso.OpenTextFile("C:\Swiler\Old.csv", ForReading, False, TristateTrue)
OutStream.Write InStream.ReadAll
OutStream.Close
Set InStream = fso.OpenTextFile(ProcessFolder & U_pageflexDataFile, ForReading, False, TristateTrue)
errLog = errLog & "Invalid data file format for <strong>" & U_pageflexDataFile & "</strong>, file is UTF-16 and should be UTF-8, please check the PageFlex integration<BR>"
Else
Set InStream = fso.OpenTextFile(ProcessFolder & U_pageflexDataFile, ForReading)
End If
Swi