[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Deserializing a string with \r\n

johnwest72

8/23/2004 10:47:00 PM

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.
2 Answers

johnwest72

9/9/2004 8:02:00 PM

0

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.

johnwest72@excite.com (john west) wrote in message news:<6128d9a8.0408231446.5d25ef2f@posting.google.com>...
> 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.

Ken Kolda

9/9/2004 8:13:00 PM

0

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

Ken


"john west" <johnwest72@excite.com> wrote in message
news:6128d9a8.0409091202.25dac85c@posting.google.com...
> 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.
>
> johnwest72@excite.com (john west) wrote in message
news:<6128d9a8.0408231446.5d25ef2f@posting.google.com>...
> > 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.