I am having a problem in which ASP.Net web services are corrupting my data.
I know that my problem is related to the standard way of encoding carriage
return linefeeds, so I need to figure out how to correctly encode them.
I am trying to return XML strings that were generated by calling
DataTable.WriteXml() from my web service, and then using DataTable.ReadXml
to deserialize the data. The problem is that some of the data in the
datatable is text, and that text might contain carriage return / linefeeds.
These carriage return linefeeds are being altered at the web services
layer - converted into just newlines.
When I receive the data on the client end, all of the linefeed characters
are stripped out. Now, I could just brute-force the linefeeds back in, but
I would much rather do it right. Is there a way to tell the encoder "Hey,
this is data payload -- Don't alter it"?
If not, is there a "right" way to cause the \r\n's that have been encoded as
\n's to be decoded back to \r\n's?