Click here to Skip to main content
15,922,166 members
Please Sign up or sign in to vote.
4.00/5 (3 votes)
See more:
I'm using an XmlWriter but everytime I create a document it is putting these three strange characters at the beginning of my document:

</b><?xml version="1.0" encoding="utf-8"?>


Has anyone else seen this and/or know how to fix it?!?!?!
Posted
Updated 4-Feb-10 0:02am
v3

John242424 wrote:
</b><?xml version="1.0" encoding="utf-8"?>

These are the UTF-8 prefix characters 0xEF,0xBB,0xBF which tells anyone reading the file how to decode it. Note that UTF-8 is NOT Unicode.
 
Share this answer
 
v2
John242424 wrote:
When I changed encoding to Unicode, these chars are gone.


Be aware that Unicode also uses prefix characters (0xFF 0xFE) to identify the encoding. In either case (UTF-8 or Unicode) if you are reading/writing with the correct C#/.NET classes you don't need to worry about this as the framework will manage it correctly for you. If you are writing your own reader/writer then make sure you manage the encoding keys correctly.
 
Share this answer
 
They are the markers used to identify the fact that the file is stored in Unicode, and the byte order UTF-8. (( So, they should be there ))
 
Share this answer
 
v2
It is normal. Leave that characters alone. They are meant to be there.
 
Share this answer
 
I think you are referring to



in your question.

Did you try to bold the 3 characters (</b> is sitting there all alone and Pre tags aren't working for more, nor are bolds, so I think this might be true.)

I am trying to make sure the question gets answered correctly because I don't think it was asked in such a way that you would get the answer you need.
 
Share this answer
 
v2
I suggest you place this as its own separate question.

Since this has been answered by several people the chances that someone with the expertise to help you will read this go down. Having follow-up questions is not a strength of this system.

Make a new quick answer with the data you just put in. I am sure someone will be able to assist you. I'm just learning datasets myself so I can't really give you any guidance.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900