I am in Visual Studio 2012 using vb.net to serialize a message to XML. Everything looks fine except that the encoding is showing Windows-1252 in the XML file and I want it to be UTF-8. I have the encoding set to create it in UTF-8 format (see code below). So I am not sure what I am missing.
Dim xml_serializer As New System.Xml.Serialization.XmlSerializer(GetType(uapRequestType))
Dim ms As New System.IO.MemoryStream
Dim setting As New System.Xml.XmlWriterSettings
setting.Indent = True
setting.Encoding = System.Text.UTF8Encoding.Default
Dim writer As Xml.XmlWriter = Xml.XmlWriter.Create(ms, setting)
xml_serializer.Serialize(writer, request)
message = System.Text.Encoding.UTF8.GetString(ms.ToArray())