Все равно не могу понять зачем тогда переключаться при передачи в режим ASCII, если интерпретатор без проблем работает с файлами, у которых переводы строк представлены как CR, LF, CR/LF (в любых вариациях).. не проще ли тогда просто в бинарном виде отдавать контент таким какой он есть.. или я что-то пропустил на этот счет?
Я реально подустал от этих конвертаций:
for i in `find ./ -type f -name \*.php`; do
cat $i | sed 's/?>//g' > buffer.cat;
cat buffer.cat | sed 's/.$//' > $i;
echo "" > buffer.cat;
done
и то это не решает ряд проблем ...
объясните дураку.. к чему это авто определение ASCII?
Привожу разумный ман на этот счет:
ASCII vs. Binary Mode
One of the least-understood aspects of FTP transfers is the difference between ASCII and Binary mode data transfers. ASCII stands for American Standard Code for Information Interchange, and is a type of character encoding based on the English language used on devices that handle information stored in text. It includes 33 non-printed control characters and 94 printed characters such as letters and punctuation.
When files are transferred in ASCII mode, the transferred data is considered to contain only ASCII formatted text. The party that is receiving the transferred data is responsible for translating the format of the received text to one that is compatible with their operating system. The most common example of how this is applied pertains to the way Windows and UNIX handle newlines. On a Windows computer, pressing the "enter" key inserts two characters in an ASCII text document - a carriage return (which places the cursor at the beginning of the line) and a line feed (which places the cursor on the line below the current one). On UNIX systems, only a line feed is used. ASCII text formatted for use on UNIX systems does not display properly when viewed on a Windows system and vice versa.
Binary mode refers to transferring files as a binary stream of data. Where ASCII mode may use special control characters to format data, binary mode transmits the raw bytes of the file being transferred. In this way, the file is transferred in its exact original form.
Which Mode Is Best?
In the vast majority of cases, the user does not need to worry about manually configuring the proper mode when transferring files. FTP clients, such as FTP Voyager, usually employ a method of automatically determining the proper transfer mode based upon the contents of the file or the file's extension. FTP Voyager calls this Auto-ASCII.
When using FTP Voyager, Auto-ASCII is the preferred (and default) transfer mode. It uses a customizable list of file extensions defined in the View | Options | Auto-ASCII Extensions menu to automatically determine whether a file should be transferred in ASCII or binary mode. The list of Auto-ASCII file extensions can be modified to include proprietary file extensions that indicates to FTP Voyager that the content of the file is ASCII formatted text.
For times when the transfer mode must be manually selected, ASCII should be used when transferring text files. While ASCII mode isn't technically necessary when transferring data between compatible file systems, as a practical matter determining the compatibility of the file systems in use by the client and server is not possible. Some of the most common file types that should be transferred in ASCII mode includes:
* txt - Plain text files.
* htm, html, css - Files containing HTML or CSS mark-up.
* asp, vbs, js - Files containing scripting delivered through HTTP.
If a file containing binary data is sent using ASCII mode, it will most likely end up being corrupted. If you're having problems with corrupted file transfers, try using binary mode when transferring the file. Some common file formats that are sometimes mistakenly transferred in ASCII mode includes:
* pdf - PDF files can contain embedded binary data such as images.
* doc - Microsoft Word documents are a binary formatted file.
* In general, all audio, video, and image file formats are binary.
Вопрос еще раз ...
Опять же - нахрен нужен тогда режим ASCII, если он может создать проблемы при переносе с одной ОС на другую в то время, как в бинарном виде файл зальется без изменений и корректно обработается интерпретатором PHP ...