.NET Serialization and encoding type

webmasterbeta

New Member
Does anyone know how to set the Encoding type when serializing an object toan XML string. The serialization method accepts a Stream, XmlTextWriter andStringWriter type but only XMLTextWriter has an encoding paramater on it'sconstructor. I want to serialize to string not file so I need to use theStringWriter. Any Ideas?Is it as simple as setting the encoding attribute in the XML doc?>><?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE greeting [<!ELEMENT greeting (#PCDATA)>]><<Pat
 
Back
Top