Click here to Skip to main content
12,064,633 members (24,717 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VBScript
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

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.

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 19-Jul-12 10:09am
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web04 | 2.8.160204.4 | Last Updated 19 Jul 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100