ID:               27671
 Updated by:       [EMAIL PROTECTED]
 Reported By:      venkateshp_2004 at yahoo dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Output Control
 Operating System: windows 2000
 PHP Version:      5CVS-2004-03-24 (dev)
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

See last message.



You may also want to use open mode modifier 't' on windows systems
which automatically converts \n to \r\n.


Previous Comments:
------------------------------------------------------------------------

[2004-03-25 03:18:15] nelson_menezes at hotmail dot com

This is not a bug; it's normal behaviour. Windows notepad works with
the standard windows text-file format, which requires two characters
for new lines (carriage return + line feed). Most other OS's only
require line feed. If you use Wordpad (which supports unix-style
endlines) instead of Notepad you'll see everything is as it should.



Replace with these lines in your code:



echo "\r\nThis is the test-line1\r\n";

echo "\r\n this is the test-line2\r\n";



Notepad should then show what you want.

------------------------------------------------------------------------

[2004-03-24 08:04:12] venkateshp_2004 at yahoo dot com

Description:
------------
Hi..! 

 

When i write the contents of the buffer which contains the data from
ob_get_contents() in a file, Instead of '\n' I am getting the unknown
charecter when i opend with the the file by using notepad.It is
creating big problem when make CRC32check of the two files.I would be
thankfull to you if you could solve it.



yours,

venki

Reproduce code:
---------------
<?php

ob_start();

echo "\nThis is the test-line1\n";

echo "\n this is the test-line2\n";

$data=ob_get_contents();

$filename="test.txt";

$handle=fopen($filename,"a+");

fwrite($handle,$data);

?>

Expected result:
----------------
In the file "test.txt" I am expecting the following

contents in the file when i opend with the notepad (not with the php
editor).



This is the test line1



This is the test line2

Actual result:
--------------
But i am getting some unknown symbol like this...





0This is the test line1 00This is the test line20






------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27671&edit=1

Reply via email to