The feedback I received was as follows after my symbol was indeed like the above in a XML file."The euro symbol in this text is not encoded correctly and needs to be in UTF-8"What could be meant by that
You need to make sure that the (unspecified) software you are using is saving the file in UTF-8 format and nothing is converting it to a different format along the way.
In iso-8859-15, the € symbol is represented by `0xA4`, replacing a different character from iso-8859-1; in windows-1252, it's `0x80`. So the various single-byte encodings vary in their placement of this symbol - UTF-8 is simply safer.
Hey I am creating a XML in a project in Visual Studio using XmlTextWriter. I just noticed I have the following line of code Encoding utf8 = new UTF8Encoding(false);Should this be set to true ?
Maybe I will make more sense like this to.Ok at the moment my euro symbol is displayed as € in my XML. After I somehow get UTF-8 encoding working how do it look like after ?
Hey bobince.Thanks for your reply. But my XML Files are created dynamically ever 15 mins or so I need to do this "UTF-8 encoding of euro symbols" somehow dynamically. Can you suggest a way i can do this via my script ?I dont understand how € differs from € in UTF-8..
@StevieB: no, `new UTF8Encoding(false)` is fine. `true` would add a UTF-8-encoded faux-BOM, which in general you don't want. If you are talking about writing `€` in an XML file, just write `€` in the file in a text editor and use ‘Save as’ to save it in the UTF-8 encoding. If you're editing in Visual Studio, I believe the encoding is in File->Advanced Save Options. It totally sucks that Windows tools still default to some useless system default codepage instead of UTF-8.
You should understand what encodings are. The canonical link at this point would be [Spolsky's](http://www.joelonsoftware.com/articles/Unicode.html). How are you creating these files? Where are you writing a `€`? Does it come from code? What does the code look like?
The files are created from a .NET script.Im writing the € in out of the elements of the XML File.The value € is pulled from the database, which was entered in the first play via CMS.Code looks i.e sample something like thisXMLwriter.WriteElementString("Prim_Status", reader_image["Prim_Status"].ToString());