Re: Re: PHP 4.0 Bug #6080 Updated: fsockopen example uses "\n" for HTTP communication
| From: | Stanislav Malyshev | Date: | Fri, 11 Aug 2000 13:05:28 +0000 |
| Subject: | Re: Re: PHP 4.0 Bug #6080 Updated: fsockopen example uses "\n" for HTTP communication | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-28602@lists.php.net to get a copy of this message | ||
BH>> However, PHP is buggy with newlines. It makes \n always to LF
BH>> which is wrong on MacOS and DOS/Win32, as reported in Bug: 6079.
BH>> It should be \x0d\x0a oder \015\012 or something alike,
BH>> otherwise it will break again if bug 6079 is fixed.
I'd call Perl buggy in this regard. \n should be one symbol on every
platform, and if you want \r\n - which is always explicitly listed on each
and every protocol, and each and every protocol specifies in a
platform-independent way, - the you write \r\n. If somebnody is too lazy
to read HTTP specs and put \r\n wherever \r\n is due - we shouldn't bend
PHP to cure laziness. That's bad kind of laziness. There's no protocol I
know which tells you "do LF in Unix and CRLF in DOS". They always
explicitly say what you need to do. And that's not PHP's business to
mangle with data - this is totally unneeded "magic". PHP should pass data
to the OS untouched, and if OS chooses to do strange thing - OK, so it
does. Weird OSes that do that have "text" mode for their files for this.
--
Stanislav Malyshev stas@zend.com
+972-3-6139665 ext.106