XML file created using XmlTextWriter

  • Thread starter Thread starter quest
  • Start date Start date
Q

quest

I created xml file using XmlTextWriter. When I opened the xml file using
binary editor, the first 3 bytes of the xml file consist of EF, BB, BF
respectively. Is there any way I can generate the XML without the mentioned
3 bytes (EF, BB, BF) ? Thanks in advance.
 
That's a UTF8 byte order mark. Try this: Choose an appropriate constructor
for your XmlTextWriter or TextWriter-derived class (or whatever you are
using) taking an Encoding class parameter. Pass a new instance of
UTF8Encoding using the constructor with parameter to not set the byte order
mark (i.e. new UTF8Encoding(false)).
 
Hi,

What Encoding are you using?

use ASCII for example and see what you get
 

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

Back
Top