Click here to Skip to main content
Rate this: bad
good
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
Edited 19-Jul-12 10:16am
(no name)114.4K
v2
Comments
Sandeep Mewara at 20-Jul-12 18:25pm
   
Share exact error.
priypavan at 23-Jul-12 12:32pm
   
Exact Error is : ADODB.Stream: Write to file failed.
priypavan at 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
0 Marcin Kozub 265
1 Richard MacCutchan 239
2 OriginalGriff 208
3 Sergey Alexandrovich Kryukov 185
4 Praneet Nadkar 167
0 OriginalGriff 7,913
1 Sergey Alexandrovich Kryukov 7,232
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,865


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 19 Jul 2012
Copyright © CodeProject, 1999-2014
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