Re: A little afternoon WTF
On 14-05-2010 01:32, markspace wrote:
Wayne wrote:
On 5/13/2010 1:12 PM, Tom Anderson wrote:
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
"<initech:tps-report><initech:coversheet> etc";
Linux or not, text files sent across the Internet must have lines
terminated with CRLF, as per the IETF. See
<http://www.rfc-editor.org/EOLstory.txt>. (I've been bitten by that more
than once, with PHP or JavaScript creating text that browsers
subsequently
refuse to read with just a LF.)
Horse pucky. It's XML, which is UTF-8 encoded by default, and also
explicitly in this example. So it's not even ASCII. And the XML spec
says all XML uses new lines only. Raw carriage returns are translated to
newlines if they are encountered in the input text.
<http://www.w3.org/TR/xml/#sec-line-ends>
If you want to quote specifications, be sure to quote the correct one.
The fact that an XML parser must return LF for CR LF does not
by magic change the rules for transports protocols and lines
of text files. If you send an XML file with N lines over the
network you expect to get an XML file with N lines not
an XML file with 1 line that if it does not get truncated
is parsed identical.
Arne