- Home /
This question was
closed Aug 22, 2017 at 07:48 AM by
Tekman03.
Question by
Tekman03 · Aug 21, 2017 at 09:16 AM ·
serializationxmlfilestreamencodingutf-8
FileMode.Create an encoded xml file in UTF-8
Hi there,
I am working on serializing data to an xml file, but it will not then re-read them because it has the wrong encoding code. Is there a way that I can add to this code that will create the file with UTF-8 encoding.
XmlSerializer serializer = new XmlSerializer(typeof(WordList));
FileStream stream = new FileStream(Application.dataPath + "/StreamingAssets/WordLists/" + WordlistName + ".xml", FileMode.Create);
serializer.Serialize(stream, wordDB);
stream.Close();
Many Thanks
Comment
Follow this Question
Related Questions
XmlException: Text node cannot appear in this state 2 Answers
Serializing invetory items data and InvalidOperationException exception 0 Answers
[SOLVED] XML Deserialization of a single XML file into multiple objects 2 Answers
ArgumentException: Path is empty while saving data in an XML 0 Answers
What are the pros and cons of ScriptableObjects vs. JSON for data files? 2 Answers