#41609 [Opn]: file_put_contents() injects \r
| From: | nlopess@php.net | Date: | Sat, 09 Jun 2007 21:03:19 +0000 |
| Subject: | #41609 [Opn]: file_put_contents() injects \r | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-113605@lists.php.net to get a copy of this message | ||
ID: 41609
Updated by: nlopess@php.net
Reported By: zoe at uk dot ibm dot com
Status: Open
Bug Type: Filesystem function related
Operating System: Windows XP
PHP Version: 6CVS-2007-06-06 (snap)
New Comment:
when files are not opened with the binary flag, windows automatically
converts \n to \r\n. I don't have time until mid-July to investigate
this problem though.
Previous Comments:
------------------------------------------------------------------------
[2007-06-06 10:48:09] zoe at uk dot ibm dot com
Hi Johannes
No, it doesn't:
E:\zoe\TESTS\slashr>e:\zoe\buildsystem\php6exe\php.exe -d
unicode.semantics=0 johannes.php
string(7) "foo
bar"
E:\zoe\TESTS\slashr>e:\zoe\buildsystem\php6exe\php.exe -d
unicode.semantics=1 johannes.php
string(7) "foo
bar"
------------------------------------------------------------------------
[2007-06-06 10:26:31] johannes@php.net
I'd assume this is some ICU feature when converting a text with
newlines from UTF-8 to UTF-16 and then back to UTF-8.
Does something like
<?php
$a = "foo\nbar";
var_dump((binary)$a);
?>
also show the \r?
------------------------------------------------------------------------
[2007-06-06 09:35:57] tony2001@php.net
No, thanks. This should be enough for somebody who knows how to debug
it on Windows.
Unfortunately, I don't.
------------------------------------------------------------------------
[2007-06-06 08:56:30] zoe at uk dot ibm dot com
Hi - sorry - I should have mentioned that the behaviour is not
reproducible on Linux. It's Windows specific. Would you like the copies
of the data.tmp files that are created in each case? - if so I'll attach
them to this.
------------------------------------------------------------------------
[2007-06-06 08:38:47] tony2001@php.net
Could you plz try the same on Linux?
I can't replicate it there.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/41609
--
Edit this bug report at http://bugs.php.net/?id=41609&edit=1