I have a module which writes XML data to a text file and saves it as .PLN file which in fact is a tagged XML file. However, when validating the file against XSD schema I get this error:
In other words, instead of saving the file in UTF-8 without BOM, as required, the resulting file is encoded in UCS-2 Little Indian. Below is a part of VBA code in question. I also attach a link to my XSD schema, if it helps.
Can you please help to correct this saving behaviour?
Thank you!
Rustam
Reason: Switch from current encoding to specified encoding not supported.
In other words, instead of saving the file in UTF-8 without BOM, as required, the resulting file is encoded in UCS-2 Little Indian. Below is a part of VBA code in question. I also attach a link to my XSD schema, if it helps.
Code:
...
...
Set fso = CreateObject("Scripting.FileSystemObject")
Set A = fso.CreateTextFile(myFile, Overwrite:=True, Unicode:=True)
[COLOR=#008000]'* XML tags are replaced with square brackets to make the code viewable in MrExcel.[/COLOR]
A.WriteLine ("[?xml version="1.0" encoding="UTF-8"?]")
A.WriteLine ("[SimBase.Document Type=""AceXML"" version=""1,0""]")
A.WriteLine (" [Descr]AceXML Document[/Descr]")
...
...
Can you please help to correct this saving behaviour?
Thank you!
Rustam
Last edited: