What is ASCII? | ASCII: the American Standard Code for Information Interchange. It's the code by which computers have stored and exchanged text for the last 40 or more years. ASCII has been the mainstay of information interchange for four decades, but it has limitations. Designed during a time when computer memory (RAM) was very expensive, it used only the low 7 of the 8 bits in a standard byte. This was adequate, and allowed the leftover bit to be used (occasionally) for other purposes. |
What is Binary? |
Binary is the number system based on 2. In this context, though, it refers to numeric, as opposed to text, information. While ASCII text uses only 7 of the 8 bits in a byte, numbers use all 8. Not only do numbers themselves use all 8 bits, but so do most other types of computerized information (all of which use numbers to represent information), including:
It comes as a surprise to many people that word processing documents, such as Microsoft Word and Word Perfect files, are binary rather than ASCII. That's because they store a great deal of information besides just the letters: they contain font and formatting information, images, user preferences, and many other "bells and whistles". |
ASCII and Binary in FTP | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Why Does FTP Have Both? |
FTP was developed at a time when typical modem speeds were 110 to 300 bits per second (as compared with 28,000 to 56,000 today). Since ASCII only used 7 bits, long files could be transmitted more quickly by not sending all the unused bits. The big drawback is that if a file that uses all 8 bits in each byte is accidentally sent using ASCII transfer, it will lose 1/8 of its information content. In most files, even the loss of one bit is enough to make it invalid, and losing 1/8 makes them totally unreadable. So ASCII transfer can be fatal to a file's health! With today's higher speeds, the time lost by sending all 8 bits of an ASCII file is practically unnoticeable. But FPT has incorporated features into ASCII transfer that make it useful for other reasons, so the two modes remain. The fact that they both remain means that FTP users need to exercise great caution in transferring files! | ||||||||||||||||||
What Extra Services Does ASCII Transfer Have? |
What features are so useful that FTP retains ASCII transfer in spite of the risk of ruining files in transmission? There are two: end-of-line translation, and end-of-file translation. Although ASCII has standardized almost all aspects of text files shared between computers, there are two areas where operating systems have "agreed to disagree". One is how you symbolize the end of a line, the other is how you mark the end of a file. When files are transferred using ASCII mode, FTP clients and servers will translate the different symbols into the native "language" of the receiving computer. This eliminates files that appear to have "garbage" in them, or that appear to be all one long line stretching from here to the horizon. There are some programs used in making the Web interactive, that depend on having the right line-break characters. In case you're interested or need to know the details, here they are:
|
How to Set Transfer Mode | |
---|---|
Setting Transfer Mode in Character-Based FTP Clients |
If you use a command-line FTP client: The default mode is ASCII. Every time you intend to transfer a binary file, you need to type the command, FTP will stay in binary mode until you change it, so if you then transfer ASCII files, you need to type the command |
How To Set Transfer Mode in a GUI-based FTP Client
|
GUI-based FTP clients are each different, but since we use WS-FTP at WCC, we'll focus on that. WS-FTP has three controls for mode: ASCII , Binary , and Auto . Auto is a check box, and does not affect the status of the other two, while ASCII and Binary are "radio buttons", meaning you have to choose one or the other. Here's how they work:
|
"Automatic" Mode |
The behavior of WS-FTP in Auto mode depends on a list of file extensions it keeps.You can access that list by clicking the Options button at the bottom of the WS-FTP LE window (or the top of the WS-FTP Pro window). |
In the Options dialog, click the Extensions button. This brings you to the list of extensions. The illustration at left shows the default list of ASCII extensions - only .TXT. (This is not case-sensitive.) If you're transferring Web files, HTML files could also be in this list.In addition, there are a number of other file type used on the Web that are text files and should be transferred using ASCII mode. These are listed in the table in the next section. |
Summary: Practical Advice | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
WS-FTP Help offers this advice:
Here's a quick overview of files and how they should be transferred:
Note about UnicodeUnicode is the system which ultimately will replace ASCII, because it has the potential to include all the characters of all human languages. It can do this because instead of 7 bits it can use 8, 16, or 32. It is still evolving, but more and more programs are coming to use it. Since it uses all the bits in each byte, it must be transferred in binary mode. Unfortunately, the extension .txt is routinely used for Unicode text files, making it impossible to tell from the extension whether to transfer it in ASCII or binary.
|
About this document... | |
---|---|
Click here for a review of this module. | |
Audience: | This is for people who are familiar with the basics of FTP and need to distinguish between files appropriate for binary transfer, and those appropriate for ASCII transfer. |
Objectives: | When you successfully complete this lesson, you will be able to...
|
Module NA36c: | This document is part of a modular instruction series in Computer Instruction. For more information, see the overview or the list of modules in this series, NA: Network Applications. This document has been used in the following classes: INP 150, INP 152, INP 220. |
Author: | Laurence J. Krieg |
Institution: | Department of Computer Information Systems , Washtenaw Community College |
History: | Original: 16 Oct 2002 This version posted Thursday, 01-Jun-2006 09:37:40 EDT |
Copyright: | Copyright © 2002, Laurence J. Krieg, Washtenaw Community College Instructors: You may point to this file in your Web-based materials. Students: you may make a copy for your personal use. |