Deserializing a string with \r\n
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.remoting.

Post a new message to this list...

john west
I serialize a string with char 13 and char 10 in it (\r\n). It's
serialized just fine. When I deserialize it, however, the 13 and 10
is replaced with just a single 10. Here's an example that can be run
in immediate mode showing the problem. The ascii value of the
character in position 2 should be 13, not 10.

?asc(ctype(new XmlSerializer(gettype(String)).Deserialize(new
StringReader("<string>aa" & vbcrlf & "bb</string>")), char())(2))

I'm sure there must be a setting or something. I mean, I know I could
just replace 10 with 13 and 10 after deserializing it, but this is in
a library, and all users aren't going to know to do that. I can't do
it in the library itself, since the object isn't always a string that
I'm deserializing.

Thanks,
John

ps. Don't reply to this email. I don't use it.
Reply to this message...
 
    
john west
I don't want to be annoying, but threads get lost quickly here. Does
anyone have any idea what's going on with this?

Thanks.

Click here to reveal e-mail address (john west) wrote in message news:<Click here to reveal e-mail address>...
[Original message clipped]

Reply to this message...
 
    
Ken Kolda
Since this isn't remoting related, you may have better luck in the VB.NET or
..NET Framework newsgroups.

Ken

"john west" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 
System.IO.StringReader
System.Xml.Serialization.XmlSerializer




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com