#27633 [NEW]: Wrong translation in ASCII mode

From: Date: Thu, 18 Mar 2004 12:27:30 +0000
Subject: #27633 [NEW]: Wrong translation in ASCII mode
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-56617@lists.php.net to get a copy of this message
From:             vrana@php.net
Operating system: Windows XP
PHP version:      4.3.5RC3
PHP Bug Type:     FTP related
Bug description:  Wrong translation in ASCII mode

Description:
------------
ftp_get() translates \n characters wrong in FTP_ASCII mode. Instead of
\r\n, they become \r on Windows. Only newline at the end of a file (if
any) is translated correct.

\r\n on remote server become \r\r.

Reproduce code:
---------------
<?php
$ftp = ftp_connect("ftp.netscape.com");
ftp_login($ftp, "anonymous", "anonymous");
ftp_pasv($ftp, true);
ftp_get($ftp, "Welcome", "Welcome", FTP_ASCII);
ftp_close($ftp);
?>


Expected result:
----------------
\r\nWelcome ...\r\n

Actual result:
--------------
\rWelcome ...\r\n

-- 
Edit bug report at http://bugs.php.net/?id=27633&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27633&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27633&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27633&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27633&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27633&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27633&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27633&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27633&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27633&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27633&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27633&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27633&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27633&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27633&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27633&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27633&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27633&r=float


Thread (17 messages)

« previous php.bugs (#56617) next »