RDunkley / XML-To-Data-Class

Tool to Generate C# custom data classes from an XML file.
Apache License 2.0
0 stars 0 forks source link

Use Encoding from parsed file #37

Closed RDunkley closed 5 years ago

RDunkley commented 5 years ago

The auto-generated code that creates the ExportToXML method uses the encoding for the XML as the same encoding that was provided in the XML file used by XML-To-Data-Class to generate the code. This means the auto-generated code could parse another XML file that does not have the same encoding. When the parsed XML is written back out the encoding would change possibly messing up some string values. Recommend storing the encoding from the parsed file in the main data class and then using that encoding when the XML file is generated.