Hi Crzysztof,
The issue would seem to be related to XML encoding and decoding. From your
HTML page, you are starting with (by default) an ASCII text encoding. Then
if you are using a properly implemented DOM, and again default encodings,
the client side XML would be encoded as UTF-8.
On the server side, the XML would need to be decoded as UTF-8 for the
newlines to be properly decoded (or if you have specified and propertly
encoded in another encoding, whatever encoding you have chosen).
Using Notepad to show the text can be introducing uncertainty into your
observations. Notepad can decode UTF-8 if BOM marks are in the file. If
BOM is not present, notepad will decode as unicode, causing some errors
being introduced that may not be there.
In general, ignoring text printouts, strings and debuggers, if your stack,
end to end, is standard compliant and your programs properly account for
the encoding variations between HTML and XML, and your service
implementation doesn't try to treat the XML received as a string, your
database will probably get the data as decoded from the XML. This may not
be the result you expect - but there will be the most accurate preservation
of the received data.
For newlines, there is the issue of platform to consider as well. Notepad,
for instance, displays a newline character (a single character) as a black
square, and the expected carriage return operation doesn't occur. On most
windows file editors, CR-NL is the expected conversion of a newline
character. A well implemented XML layer, such as the MS-XML DOM, can help
you, as will the ASP.NET (.NET framework) XML serializer when conversion is
done from XML to string.
If you are going cross platform, the best answer is to use the XML layer in
the middle that is appropriate for each platform, and allow that to
properly deal withe newline characters instead of directly displaying them
in text editors.
I hope this helps,
Dan Rogers
Microsoft Corporation
--------------------
>From: Krzysztof Fink-Finowicki via .NET 247 <anonymous@dotnet247.com>
>X-Newsreader: AspNNTP 1.50 (Matthew Reynolds Consulting)
[quoted text clipped - 8 lines]
>Lines: 1
>Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12
phx.gbl
>Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:26321
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
>
>Hi,
>
>I fill-in text in TEXTAREA tag on HTML page, then send its content via content of XML element parameter sent through WebService function from
JavaScript.
>On client side, I can read my text in debugger as:
>
[quoted text clipped - 28 lines]
>
><Id>sAs4+gU7UEemOxcQMxH2qw==</Id