memory stream, xmltextwriter issue

H

hharry

hi all

i have the following class:

<Serializable()> _
Public Class MVR_Inputs
Public FirstName As String
Public MiddleName As String
Public LastName As String
Public Suffix As String
Public Dob As String
Public Ssn As String
Public Gender As String
Public DriversLicenseNumber As String
Public DriversLicenseState As String
Public YouthCheck As String
Public CustomerBatchID As String
Public CustomerOrderID As String
Public TestMode As Boolean = False
Public TimePeriod As Integer
Public RequestType As String
End Class

which i attempt to serialize by using this code:

Dim objMemStrm As MemoryStream
Dim objXmlWriter As XmlTextWriter
Dim objXmlSerializer As XmlSerializer
Dim byteArray() As Byte

objMemStrm = New MemoryStream
objXmlWriter = New XmlTextWriter(objMemStrm, Encoding.UTF8)
objXmlSerializer = New XmlSerializer(oSubject.GetType())
objXmlSerializer.Serialize(objXmlWriter, oSubject)
byteArray = objMemStrm.GetBuffer
sSerializedReq = System.Text.Encoding.UTF8.GetString(byteArray)

the serialization works fine, except that the first character of of
sSerializedReq is always ASCII character 239 - an i with 2 small dots
on top

any ideas ?

thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top