XML problem

G

Guest

I have a problem with an XML file which is e-mailed to a company which
converts it into invoices for our customers. I have sent them various test
files over the past few months and upto last week they converted them with no
problems. With the most recent files, they are getting errors with the
encodeing line. In example 1 the encoding is adding the first 4 characters,
the correct encoding is shown in example 2. I'm new to XML so I don't know
where to look in how to solve this problem.

1) ï>>¿<?xml version = "1.0"encoding="utf-8" standalone="no"?>

2) <?xml version = "1.0"encoding="utf-8" standalone="no"?>

This is my program code which creates the export file:

Imports System.Xml
Imports System.Xml.XmlReader
Imports System.Xml.XmlTextWriter
Imports System.Xml.XmlDocument
Imports System.Xml.XmlText
Imports System.Xml.XmlWriter
Dim invoicetextwriter = New Xml.XmlTextWriter("c:\invoices.xml",
System.Text.Encoding.UTF8)

They have asked if I could use UTF16, but this doesn't appear on the
"System.Text.Encoding" list.
 
G

Guest

Try this:

Dim invoicetextwriter = New Xml.XmlTextWriter("c:\invoices.xml", New
UTF8Encoding(False))

It ought to avoid the unicode preample in your file.

HTH, Jakob.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top