Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
Here is the sample code I am using for generating the HTML file but it fails to support UTF8, it creates the html with %CD%%..etc

VB
Set xmlSource = CreateObject("MSXML2.DOMDocument")
Set xmlXForm = CreateObject("MSXML2.DOMDocument")
Set args = WScript.Arguments
xmlFile = args.Item(0)
xslFile = args.Item(1)
outputFile = args.Item(2)

Set fileSystemObject = CreateObject("Scripting.FileSystemObject")
fileSystemObject.CreateTextFile(outputfile)
Set fileObject = fileSystemObject.GetFile(outputfile)
Set outFileStream = fileObject.OpenAsTextStream(2,-1)
outFileStream.Write(output)
outFileStream.Close


I found a solution in java script but it throws error saying runtimeerror, here is that sample, can some one correct it.

VB
Set fileSystemObject = CreateObject("Scripting.FileSystemObject")
Set utf8Enc = new ActiveXObject("Utf8Lib.Utf8Enc");

fileSystemObject.CreateTextFile(outputfile)
Set fileObject = fileSystemObject.GetFile(outputfile)
Set outFileStream = fileObject.OpenAsTextStream(2,-1)
outFileStream.Write(utf8Enc.UnicodeT(output))
outFileStream.Close


thanks in advance
Posted
v2
Comments
Sandeep Mewara 20-Jul-12 18:25pm    
Share exact error.
priypavan 23-Jul-12 12:32pm    
Exact Error is : ADODB.Stream: Write to file failed.
priypavan 26-Jul-12 20:00pm    
any update on this?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900