Quantcast
Channel: Internet Explorer 8, 9, 10, 11 forum
Viewing all articles
Browse latest Browse all 10469

Using “Save As” execCommand in IE8 to save XML file in ANSI format instead of UCS2-Little Endian

$
0
0

I am currently trying to save an XML data using "SaveAs" execCommand  from Javascript in Internet Explorer 8 only.I am using document.write(xml) to write the xml content after i open a window.The document object in IE8 uses a saveAs Exec Command to allow the user to save the xml file in the local folder.The XML file is generated but it doesnt set the encoding to my preferred type  for a different interface where i need to send this XML which is ANSI/UTF-8.I can only save the XML in UCS2 little Endian format.Below is the code i am using.

     var location = "D:\\export_to_MCT"+dateTime+".xml";
   
        var xml = tmpSelectedConfigurationXML.transformNode(xslDoc);// XML Is generated here
       alert(xml);
         **var testlink = window.open  ("about:blank","_blank","toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,left=10000, top=10000, width=10, height=10, visible=none");
         testlink.document.write(xml); //fileData has contents for the file
    testlink.document.close();
    testlink.document.execCommand('SaveAs', false, location);**
    testlink.close();

My purpose is to save the xml  in ANSI/UTF-8 without BOM format.I cant use Scripting.FileSystemObject method of ActiveX object.Please suggest

 


Viewing all articles
Browse latest Browse all 10469

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>