![]() Now I analyzed the files that worked, and those that didn't - and the difference is a three-byte prefix in the binary data ( 0圎F 0xBB 0xBF) - the "Unicode BOM" (Byte-Order Mark). Person person = ser.Deserialize(xr) as Person Ĭonsole.WriteLine("ERROR: ", exc.GetType().Name, exc.Message) ![]() XmlSerializer ser = new XmlSerializer(typeof(Person)) Using (XmlReader xr = XmlReader.Create(str, settings)) Using (StringReader str = new StringReader(contentAsString)) Settings.IgnoreProcessingInstructions = true XmlReaderSettings settings = new XmlReaderSettings() deserialize that string into a "Person" instance Something like this: // get bytes from SFTP serverīyte content = _sftpClient.Download(fileName)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |