deserialize and utf8 encoding



Hi,

I'm having a problem deserializing my streams since they are utf8 encoded
(they are being received over tcp/ip) so I was looking for a way to make the
serializer use utf8, is there any?

I'm getting the following error:
There is an error in XML document (0, 0).
innerexception: There is no Unicode byte order mark. Cannot switch to
Unicode."

public T Deserialize(Stream s)
{
XmlSerializer serializer = new XmlSerializer(typeof(T));
try
{
s.Position = 0;
return (T)serializer.Deserialize(s);
}
catch (Exception ex)
{
throw new InvalidOperationException("Failed to " +
"create object", ex);
}
}


.


Loading