ASCII: Difference between revisions

Content deleted Content added
Hym3242 (talk | contribs)
Unicode does not have millions of code points anymore. It is limited to 17 planes of 65536 characters each, about 1.1 million.
(36 intermediate revisions by 24 users not shown)
Line 2:
{{hatnote group|
{{other uses}}
{{Distinguish|text=MS [[Windows-1252]] or other types of [[Extendedextended ASCII]]}}
}}
{{Use mdy dates|date=June 2013|cs1-dates=y}}
Line 11:
| mime = us-ascii
| image = USASCII code chart.png
| caption = ASCII chart from [[MIL-STD-188#MIL-STD-188-100_series100 series|MIL-STD-188-100]] (1972)
| lang = [[English language|English]] (made for; does not support all loanwords), [[Malay language|Malay]], [[Rotokas alphabet|Rotokas]], [[Interlingua]], [[Ido]], and [[X-SAMPA]] <!-- not Latin, see [[Apex (diacritic)]] and [[Interpunct]] -->
| extensions = * [[Unicode]]
Line 23:
| classification = [[ISO/IEC 646|ISO/IEC 646 series]]
}}
'''ASCII''' ({{IPAc-en|audio=En-us-ASCII.ogg|ˈ|æ|s|k|iː}} {{respell|ASS|kee}}),<ref name="Mackenzie_1980">{{cite book |url=https://textfiles.meulie.net/bitsaved/Books/Mackenzie_CodedCharSets.pdf |title=Coded Character Sets, History and Development |series=The Systems Programming Series |author-last=Mackenzie |author-first=Charles E. |date=1980 |edition=1 |publisher=[[Addison-Wesley Publishing Company, Inc.]] |isbn=978-0-201-14460-4 |lccn=77-90165 |pages=6, 66, 211, 215, 217, 220, 223, 228, 236–238, 243–245, 247–253, 423, 425–428, 435–439 |access-date=2019-08-25 |archive-url=https://web.archive.org/web/20160526172151/https://textfiles.meulie.net/bitsaved/Books/Mackenzie_CodedCharSets.pdf |archive-date=May 26, 2016 |url-status=live |df=mdy-all }}</ref>{{rp|6}} abbreviatedan fromacronym for '''American Standard Code for Information Interchange''', is a [[character encoding]] standard for electronic communication. ASCII codes represent text in computers, [[telecommunications equipment]], and other devices. Because of technical limitations of computer systems at the time it was invented, ASCII has just 128 [[code point]]s, of which only 95 are {{Pslink|printable characters}}, which severely limited its scope. Modern computer systems have evolved to use [[Unicode]], which has millionsover ofa million code points, but the first 128 of these are the same as the ASCII set.
 
The [[Internet Assigned Numbers Authority]] (IANA) prefers the name '''US-ASCII''' for this character encoding.<ref name="IANA_2007">{{cite web|website=Internet Assigned Numbers Authority (IANA)|date=May 14, 2007|url=https://www.iana.org/assignments/character-sets|title=Character Sets|access-date=2019-08-25}}</ref>
 
ASCII is one of the [[IEEE]] milestones.<ref>{{Cite web |date=2016-03-29 |title=Milestone-Proposal:ASCII MIlestone - IEEE NJ Coast Section |url=https://ieeemilestones.ethw.org/Milestone-Proposal:ASCII_MIlestone_-_IEEE_NJ_Coast_Section |access-date=2024-02-26 |website=IEEE Milestones Wiki |language=en}}</ref>
ASCII is one of the IEEE milestones.
 
==Overview==
ASCII was developed in part from [[telegraph code]]. Its first commercial use was in the [[Teletype Model 33]] and the Teletype Model 35 as a seven-[[bit]] [[teleprinter]] code promoted by Bell data services.{{when|date=November 2021}} Work on the ASCII standard began in May 1961, with the first meeting of the American Standards Association's (ASA) (now the [[American National Standards Institute]] or ANSI) X3.2 subcommittee. The first edition of the standard was published in 1963,<ref name="Brandel_1999">{{cite news |author-first=Mary |author-last=Brandel |date=July 6, 1999 |url=http://edition.cnn.com/TECH/computing/9907/06/1963.idg/ |title=1963: The Debut of ASCII |publisher=[[CNN]] |access-date=2008-04-14 |archive-url=https://web.archive.org/web/20130617155922/http://edition.cnn.com/TECH/computing/9907/06/1963.idg/ |archive-date=June 17, 2013 |url-status=live }}</ref><ref name="ASCII-1963">{{cite web |title=American Standard Code for Information Interchange, ASA X3.4-1963 |publisher=[[American Standards Association]] |date=1963-06-17 |url=https://www.sr-ix.com/Archive/CharCodeHist/X3.4-1963/index.html |website=Sensitive Research |access-date=2020-06-06}}</ref> underwent a major revision during 1967,<ref name="ASCII-1967">{{cite tech report |title=USA Standard Code for Information Interchange, USAS X3.4-1967 |publisher=[[United States of America Standards Institute]] (USASI) |date=July 7, 1967}}</ref><ref name="Jennings_2016">{{cite web |title=An annotated history of some character codes or ASCII: American Standard Code for Information Infiltration |author-first=Thomas Daniel |author-last=Jennings |author-link=Thomas Daniel Jennings |website=Sensitive Research (SR-IX) |date=2016-04-20 |orig-year=1999 |url=https://www.sr-ix.com/Archive/CharCodeHist/index.html#ASCII-1967 |access-date=2020-03-08}}</ref> and experienced its most recent update during 1986.<ref name="ASCII-1986">{{cite tech report |title=American National Standard for Information Systems — Coded Character Sets — 7-Bit American National Standard Code for Information Interchange (7-Bit ASCII), ANSI X3.4-1986 |publisher=[[American National Standards Institute]] (ANSI) |date=March 26, 1986}}</ref> Compared to earlier telegraph codes, the proposed Bell code and ASCII were both ordered for more convenient sorting (i.e., alphabetization) of lists and added features for devices other than teleprinters.<ref name="ASCII-1986" />
 
The use of ASCII format for Network Interchange was described in 1969.<ref name="RFC-20_1968">{{cite IETF |title=ASCII format for Network Interchange |rfc=20 |author-first=Vint |author-last=Cerf |author-link=Vint Cerf |date=October 16, 1969 |publisher=Network Working Group |access-date=2016-06-13}} (NB. Almost identical wording to [[USAS X3.4-1968]] except for the intro.)</ref> That document was formally elevated to an Internet Standard in 2015.<ref>{{cite web |url=https://datatracker.ietf.org/doc/status-change-rfc20-ascii-format-to-standard/ |title=Correct classification of RFC 20 (ASCII format) to Internet Standard |author=Barry Leiba |date=January 12, 2015 |publisher=[[Internet Engineering Task Force|IETF]]}}</ref>
Line 40:
Despite being an American standard, ASCII does not have a code point for the [[Cent (currency)|cent]] (¢). It also does not support [[English terms with diacritical marks]] such as [[résumé]] and [[jalapeño]], or [[proper nouns]] with diacritical marks such as [[Beyoncé]].
 
==<span class="anchor" id="1963"></span><span class="anchor" id="1965"></span><span class="anchor" id="1967"></span><span class="anchor" id="1968"></span><span class="anchor" id="1977"></span><span class="anchor" id="1986"></span><span class="anchor" id="1992"></span><span class="anchor" id="1997"></span><span class="anchor" id="2002"></span><span class="anchor" id="2007"></span><span class="anchor" id="2012"></span><span class="anchor" id="2017"></span><span class="anchor" id="2022"></span>History==
[[File:ASCII1963-infobox-paths.svg|thumb|upright=1.25|right|ASCII (1963). [[Control Pictures]] of equivalent controls are shown where they exist, or a grey dot otherwise.]]
The American Standard Code for Information Interchange (ASCII) was developed under the auspices of a committee of the American Standards Association (ASA), called the X3 committee, by its X3.2 (later X3L2) subcommittee, and later by that subcommittee's X3.2.4 working group (now [[INCITS]]). The ASA later became the United States of America Standards Institute (USASI)<ref name="Mackenzie_1980"/>{{rp|211}} and ultimately became the [[American National Standards Institute]] (ANSI).
Line 46:
With the other special characters and control codes filled in, ASCII was published as ASA X3.4-1963,<ref name="ASCII-1963"/><ref name="Bukstein_1964">{{cite journal |title=Binary Computer Codes and ASCII |author-first=Ed |author-last=Bukstein |journal=[[Electronics World]] |date=July 1964 |volume=72 |number=1 |pages=28–29 |url=http://www.swtpc.com/mholley/ElectronicsWorld/Jul1964/EW_Jul1964.htm |access-date=2016-05-22 |archive-url=https://web.archive.org/web/20160303180933/http://www.swtpc.com/mholley/ElectronicsWorld/Jul1964/EW_Jul1964.htm |archive-date=March 3, 2016 |url-status=dead }}</ref> leaving 28 code positions without any assigned meaning, reserved for future standardization, and one unassigned control code.<ref name="Mackenzie_1980"/>{{rp|66, 245}} There was some debate at the time whether there should be more control characters rather than the lowercase alphabet.<ref name="Mackenzie_1980"/>{{rp|435}} The indecision did not last long: during May 1963 the CCITT Working Party on the New Telegraph Alphabet proposed to assign lowercase characters to ''sticks''{{Efn|name="NB_Stick"|{{anchor|Stick}}The 128 characters of the 7-bit ASCII character set are divided into eight 16-character groups called ''sticks'' 0–7, associated with the three [[most-significant bit]]s.<ref name="Bemer_1980_Inside"/> Depending on the horizontal or vertical representation of the character map, ''sticks'' can correspond with either table rows or columns.}}<ref name="Bemer_1980_Inside"/> 6 and 7,<ref name="CCITT_1963">Brief Report: Meeting of CCITT Working Party on the New Telegraph Alphabet, May 13–15, 1963.</ref> and [[International Organization for Standardization]] TC 97 SC 2 voted during October to incorporate the change into its draft standard.<ref name="ISO_1963">Report of ISO/TC/97/SC 2 – Meeting of October 29–31, 1963.</ref> The X3.2.4 task group voted its approval for the change to ASCII at its May 1963 meeting.<ref>Report on Task Group X3.2.4, June 11, 1963, Pentagon Building, Washington, DC.</ref> Locating the lowercase letters in ''sticks''{{Efn|name="NB_Stick"}}<ref name="Bemer_1980_Inside"/> 6 and 7 caused the characters to differ in bit pattern from the upper case by a single bit, which simplified [[case-insensitive]] character matching and the construction of keyboards and printers.
 
The X3 committee made other changes, including other new characters (the [[brace (punctuation)|brace]] and [[vertical bar]] characters),<ref>Report of Meeting No. 8, Task Group X3.2.4, December 17 and 18, 1963</ref> renaming some control characters (SOM became start of header (SOH)) and moving or removing others (RU was removed).<ref name="Mackenzie_1980"/>{{rp|247–248}} ASCII was subsequently updated as USAS X3.4-1967,<ref name="ASCII-1967"/><ref name="Winter_2010">{{cite web |title=US and International standards: ASCII |url=http://homepages.cwi.nl/~dik/english/codes/stand.html#ascii |author-first=Dik T. |author=Winter |date=2010 |orig-year=2003 |url-status=dead |archive-url=https://web.archive.org/web/20100116001012/http://homepages.cwi.nl/~dik/english/codes/stand.html#ascii |archive-date=2010-01-16}}</ref> then USAS X3.4-1968,<ref name="ASCII-1968">{{cite tech report |title=USA Standard Code for Information Interchange, USAS X3.4-1968 |url=https://archive.org/details/enf-ascii-1968-1970/ |publisher=[[United States of America Standards Institute]] (USASI) |date=October 10, 1968}}</ref> ANSI X3.4-1977, and finally, ANSI X3.4-1986.<ref name="ASCII-1986"/><ref name="Salste_2016">{{cite web |title=7-bit character sets: Revisions of ASCII |author-first=Tuomas |author-last=Salste |publisher=Aivosto Oy |date=January 2016 |id={{URN|nbn|fi-fe201201011004}} |url=http://www.aivosto.com/vbtips/charsets-7bit.html#body |access-date=2016-06-13 |url-status=live |archive-url=https://web.archive.org/web/20160613145224/http://www.aivosto.com/vbtips/charsets-7bit.html#body |archive-date=2016-06-13}}</ref>
 
===Revisions of the ASCII standard:===
 
* ASA <!-- Standard -->X3.4-1963<ref name="Mackenzie_1980"/><ref name="ASCII-1963"/><ref name="Winter_2010"/><ref name="Salste_2016"/>
* ASA X3.4-1965 (approved, but not published, nevertheless used by [[IBM 2260]] & [[IBM 2265|2265]] Display Stations and [[IBM 2848]] Display Control)<ref name="Mackenzie_1980"/>{{rp|423, 425–428, 435–439}}<ref name="SA_215">{{cite journal |title=Information<!-- Title of issue, not title of article --> |date=September 1966 |volume=215 |number=3 |type=special edition |journal=[[Scientific American]] |jstor=e24931041 }}</ref><ref name="Winter_2010"/><ref name="Salste_2016"/>
* USAS <!-- USA Standard -->X3.4-1967<ref name="Mackenzie_1980"/><ref name="ASCII-1967"/><ref name="Salste_2016"/>
* USAS X3.4-1968<!-- October 1968 --><ref name="Mackenzie_1980"/><ref name="ASCII-1968"/><ref name="Salste_2016"/>
* ANSI <!-- American National Standard -->X3.4-1977<ref name="Salste_2016"/>
* ANSI X3.4-1986<ref name="ASCII-1986"/><ref name="Salste_2016"/>
* ANSI X3.4-1986 (R1992)
* ANSI X3.4-1986 (R1997)
* ANSI INCITS 4-1986 (R2002)<ref name="Korpela_2014">{{cite book |title=Unicode Explained – Internationalize Documents, Programs, and Web Sites |author-first=Jukka K. |author-last=Korpela |edition=2nd release of 1st |date=2014-03-14 |orig-year=2006-06-07 |publisher=[[O'Reilly Media, Inc.]] |isbn=978-0-596-10121-3 |page=118}}</ref>
* ANSI INCITS 4-1986 (R2007)<!-- official name with space and with (round brackets) --><ref name="ANSI_INCITS_4-1986_2007">{{citation |title=ANSI INCITS 4-1986 (R2007): American National Standard for Information Systems – Coded Character Sets – 7-Bit American National Standard Code for Information Interchange (7-Bit ASCII) |date=2007 |orig-year=1986 }}</ref>
* (ANSI)<!-- not sure if "ANSI" is still part of the standard's official name, hence put in brackets for now --> INCITS 4-1986[ (R2012]<!-- official name without space and with [square brackets] -->)<ref name="INCITS_4-1986_R2012"/>
* (ANSI) INCITS 4-1986[ (R2017]<!-- official name without space and with [square brackets] -->)<ref name="INCITS_4-1986_R2017"/>
* INCITS 4-1986 (R2022)<ref>https://webstore.ansi.org/standards/incits/incits1986r2022</ref>
 
In the X3.15 standard, the X3 committee also addressed how ASCII should be transmitted ([[least significant bit]] first)<ref name="Mackenzie_1980"/>{{rp|249–253}}<ref name="X3.15-1966">{{citation |title=Bit Sequencing of the American National Standard Code for Information Interchange in Serial-by-Bit Data Transmission |id=X3.15-1966 |date=1966 |publisher=[[American National Standards Institute]] (ANSI)}}</ref> and recorded on perforated tape. They proposed a [[9-track]] standard for magnetic tape and attempted to deal with some [[punched card]] formats.
Line 69 ⟶ 70:
 
===Bit width===
The X3.2 subcommittee designed ASCII based on the earlier teleprinter encoding systems. Like other [[character encoding]]s, ASCII specifies a correspondence between digital bit patterns and [[character (computing)|character]] symbols (i.e. [[grapheme]]s and [[control character]]s). This allows [[Digital data|digital]] devices to communicate with each other and to process, store, and communicate character-oriented information such as written language. Before ASCII was developed, the encodings in use included 26 [[English alphabet|alphabetic]] characters, 10 [[numerical digit]]s, and from 11 to 25 special graphic symbols. To include all these, and control characters compatible with the [[CCITT|Comité Consultatif International Téléphonique et Télégraphique]] (CCITT) [[International Telegraph Alphabet No. 2]] (ITA2) standard of 19241932,<ref name="Bruxy_2005">{{Citecite web |date=2005-10-10 |title=BruXy: Radio Teletype communication |url=http://bruxyhandle.regnetitu.czint/web11.1004/hamradio/EN/radio-teletype-communication020.1000/4.5.43.en.101 |urltitle=Telegraph Regulations and Final Protocol (Madrid, 1932) |access-statusdate=live9 Jun 2024 |archive-url=https://web.archive.org/web/2016041213003520230821020920/httphttps://bruxysearch.regnetitu.czint/webhistory/hamradio/EN/radio-teletype-communicationHistoryDigitalCollectionDocLibrary/4.5.43.en.101.pdf |archive-date=April21 12,August 2016 |access-date=2016-05-09 |quote=The transmitted code use International Telegraph Alphabet No. 2 (ITA-2) which was introduced by CCITT in 1924.2023}}</ref><ref name="bdcode">{{cite web |author-last=Smith |author-first=Gil |title=Teletype Communication Codes |publisher=Baudot.net |date=2001 |url=http://www.baudot.net/docs/smith--teletype-codes.pdf |access-date=2008-07-11 |archive-url=https://web.archive.org/web/20080820043949/http://www.baudot.net/docs/smith--teletype-codes.pdf |archive-date=August 20, 2008 |url-status=live }}</ref> [[FIELDATA]] (1956{{citation needed|date=June 2016|reason=My sources state 1957 rather than 1956, but Wikipedia states 1956 in various places. This needs to be sorted out with better sources.}}), and early [[EBCDIC]] (1963), more than 64 codes were required for ASCII.
 
ITA2 was in turn based on the [[Baudot code]], the 5-bit telegraph code that Émile Baudot invented in 1870 and patented in 1874.<ref name="bdcode" />
 
The committee debated the possibility of a [[Shift code|shift]] function (like in [[ITA2]]), which would allow more than 64 codes to be represented by a [[six-bit character code|six-bit code]]. In a shifted code, some character codes determine choices between options for the following character codes. It allows compact encoding, but is less reliable for [[data transmission]], as an error in transmitting the shift code typically makes a long part of the transmission unreadable. The standards committee decided against shifting, and so ASCII required at least a seven-bit code.<ref name="Mackenzie_1980"/>{{rp|pages=215 §13.6, 236 §4}}
Line 80 ⟶ 81:
The code itself was patterned so that most control codes were together and all graphic codes were together, for ease of identification. The first two so-called ''ASCII sticks''{{Efn|name="NB_Stick"}}<ref name="Bemer_1980_Inside"/> (32 positions) were reserved for control characters.<ref name="Mackenzie_1980"/>{{rp|220, 236 8,9)}} The [[Space (punctuation)|"space" character]] had to come before graphics to make [[sorting algorithm|sorting]] easier, so it became position 20<sub>[[hexadecimal|hex]]</sub>;<ref name="Mackenzie_1980"/>{{rp|237 §10}} for the same reason, many special signs commonly used as separators were placed before digits. The committee decided it was important to support uppercase [[sixbit code pages|64-character alphabets]], and chose to pattern ASCII so it could be reduced easily to a usable 64-character set of graphic codes,<ref name="Mackenzie_1980"/>{{rp|228, 237 §14}} as was done in the [[DEC SIXBIT]] code (1963). [[Lower case|Lowercase]] letters were therefore not interleaved with [[uppercase]]. To keep options available for lowercase letters and other graphics, the special and numeric codes were arranged before the letters, and the letter ''A'' was placed in position 41<sub>[[hexadecimal|hex]]</sub> to match the draft of the corresponding British standard.<ref name="Mackenzie_1980"/>{{rp|238 §18}} The digits 0–9 are prefixed with 011, but the remaining [[Nibble|4 bits]] correspond to their respective values in binary, making conversion with [[binary-coded decimal]] straightforward (for example, 5 in encoded to 011''0101'', where 5 is ''0101'' in binary).
 
Many of the non-alphanumeric characters were positioned to correspond to their shifted position on typewriters; an important subtlety is that these were based on ''mechanical'' typewriters, not ''electric'' typewriters.<ref name="Savard">{{cite web |title=Computer Keyboards |url=http://www.quadibloc.com/comp/kybint.htm |author-first=John J. G. |author-last=Savard |access-date=2014-08-24 |archive-url=https://web.archive.org/web/20140924183236/http://www.quadibloc.com/comp/kybint.htm |archive-date=September 24, 2014 |url-status=live }}</ref> Mechanical typewriters followed the [[de facto standard|''de facto'' standard]] set by the [[Remington No. 2]] (1878), the first typewriter with a shift key, and the shifted values of <code>23456789-</code> were <code>"#$%_&'()</code>{{snd}} early typewriters omitted ''0'' and ''1'', using ''O'' (capital letter ''o'') and ''l'' (lowercase letter ''L'') instead, but <code>1!</code> and <code>0)</code> pairs became standard once 0 and 1 became common. Thus, in ASCII <code>!"#$%</code> were placed in the second stick,{{Efn|name="NB_Stick"}}<ref name="Bemer_1980_Inside"/> positions 1–5, corresponding to the digits 1–5 in the adjacent stick.{{Efn|name="NB_Stick"}}<ref name="Bemer_1980_Inside"/> The parentheses could not correspond to ''9'' and ''0'', however, because the place corresponding to ''0'' was taken by the space character. This was accommodated by removing <code>_</code> (underscore) from ''6'' and shifting the remaining characters, which corresponded to many European typewriters that placed the parentheses with ''8'' and ''9''. This discrepancy from typewriters led to [[bit-paired keyboard]]s, notably the [[Teletype Model 33]], which used the left-shifted layout corresponding to ASCII, differently from traditional mechanical typewriters.
 
Electric typewriters, notably the [[IBM Selectric]] (1961), used a somewhat different layout that has become ''de facto'' standard on computers{{snd}} following the [[IBM PC]] (1981), especially [[Model M]] (1984){{snd}} and thus shift values for symbols on modern keyboards do not correspond as closely to the ASCII table as earlier keyboards did. The <code>/?</code> pair also dates to the No. 2, and the <code>,&lt; .&gt;</code> pairs were used on some keyboards (others, including the No. 2, did not shift <code>,</code> (comma) or <code>.</code> (full stop) so they could be used in uppercase without unshifting). However, ASCII split the <code>;:</code> pair (dating to No. 2), and rearranged mathematical symbols (varied conventions, commonly <code>-* =+</code>) to <code>:* ;+ -=</code>.
Line 97 ⟶ 98:
==<span class="anchor" id="Code chart"></span><span class="anchor" id="ASCII printable code chart"></span><span class="anchor" id="ASCII printable characters"></span>Character set==
 
[[File:ASCII Table (suitable for printing).svg|thumb]]
{|{{chset-table-header1|ASCII (1977/1986)}}
|-
Line 129 ⟶ 131:
| {{chset-ctrl1 | 25 U+0019: Control (alias END OF MEDIUM) (alias EOM) | [[End of medium|&nbsp;EM&nbsp;]] | style=background:#FFD }}
| {{chset-ctrl1 | 26 U+001A: Control (alias SUBSTITUTE) (alias SUB) | [[Substitute character|SUB]] | style=background:#FEE }}
| {{chset-ctrl1 | 27 U+001B: Control (alias ESCAPE) (alias ESC) | [[Escape character#ASCII escape character|ESC]] | style=background:#FFD }}
| {{chset-ctrl1 | 28 U+001C: Control (alias INFORMATION SEPARATOR FOUR) (alias FILE SEPARATOR) (alias FS) | [[File separator|&nbsp;FS&nbsp;]] | style=background:#FFD }}
| {{chset-ctrl1 | 29 U+001D: Control (alias INFORMATION SEPARATOR THREE) (alias GROUP SEPARATOR) (alias GS) | [[Group separator|&nbsp;GS&nbsp;]] | style=background:#FFD }}
Line 253 ⟶ 255:
===<span class="anchor" id="ASCII control characters"></span>Control characters===
[[File:US ASCII Control Character Symbols.png|thumb|right|Early symbols assigned to the 32 control characters, space and delete characters. ([[ISO 2047]], MIL-STD-188-100, 1972)]]
{{Main|Control characterscharacter}}
ASCII reserves the first 32 [[code point]]s (numbers 0–31 decimal) and the last one (number 127 decimal) for [[control character]]s. These are codes intended to control [[peripheral device]]s (such as [[computer printer|printers]]), or to provide [[Metadata|meta-information]] about data streams, such as those stored on magnetic tape. Despite their name, these code points do not represent printable characters (i.e. they are not characters at all, but signals). For debugging purposes, "placeholder" symbols (such as those given in [[ISO 2047]] and its predecessors) are assigned to them.
 
Line 262 ⟶ 264:
Probably the most influential single device affecting the interpretation of these characters was the [[Teletype Model 33]] ASR, which was a printing terminal with an available [[punched tape|paper tape]] reader/punch option. Paper tape was a very popular medium for long-term program storage until the 1980s, less costly and in some ways less fragile than magnetic tape. In particular, the Teletype Model 33 machine assignments for codes 17 (control-Q, DC1, also known as XON), 19 (control-S, DC3, also known as XOFF), and 127 ([[Delete key|delete]]) became ''de facto'' standards. The Model 33 was also notable for taking the description of control-G (code 7, BEL, meaning audibly alert the operator) literally, as the unit contained an actual bell which it rang when it received a BEL character. Because the keytop for the O key also showed a left-arrow symbol (from ASCII-1963, which had this character instead of [[underscore]]), a noncompliant use of code 15 (control-O, shift in) interpreted as "delete previous character" was also adopted by many early timesharing systems but eventually became neglected.
 
When a Teletype 33 ASR equipped with the automatic paper tape reader received a control-S (XOFF, an abbreviation for transmit off), it caused the tape reader to stop; receiving control-Q (XON, transmit on) caused the tape reader to resume. This so-called [[Flow control (data)|flow control]] technique became adopted by several early computer operating systems as a "handshaking" signal warning a sender to stop transmission because of impending [[buffer overflow]]; it persists to this day in many systems as a manual output control technique. On some systems, control-S retains its meaning, but control-Q is replaced by a second control-S to resume output.
 
The 33 ASR also could be configured to employ control-R (DC2) and control-T (DC4) to start and stop the tape punch; on some units equipped with this function, the corresponding control character lettering on the keycap above the letter was TAPE and <s>TAPE</s> respectively.<ref name="McConnell">{{cite web |title=Understanding ASCII Codes |author-last1=McConnell |author-first1=Robert |author-last2=Haynes |author-first2=James |author-last3=Warren |author-first3=Richard |url=http://www.nadcomm.com/ascii_code.htm |access-date=2014-05-11 |archive-url=https://web.archive.org/web/20140227190425/http://www.nadcomm.com/ascii_code.htm |archive-date=February 27, 2014 |url-status=dead}}</ref>
 
====Delete vs backspace====
The Teletype could not move its typehead backwards, so it did not have a key on its keyboard to send a BS (backspace). Instead, there was a key marked {{keypress|RUB OUT}} that sent code 127 (DEL). The purpose of this key was to erase mistakes in a manually-input paper tape: the operator had to push a button on the tape punch to back it up, then type the rubout, which punched all holes and replaced the mistake with a character that was intended to be ignored.<ref>{{cite mailing list |url=http://lists.gnu.org/archive/html/help-gnu-emacs/2014-05/msg00448.html |title=Re: editor and word processor history (was: Re: RTF for emacs) |author=Barry Margolin |mailing-list=help-gnu-emacs |date=May 29, 2014 |access-date=July 11, 2014 |archive-url=https://web.archive.org/web/20140714133149/http://lists.gnu.org/archive/html/help-gnu-emacs/2014-05/msg00448.html |archive-date=July 14, 2014 |url-status=live }}</ref> Teletypes were commonly used with the less-expensive computers from [[Digital Equipment Corporation]] (DEC); these systems had to use what keys were available, and thus the DEL character was assigned to erase the previous character.<ref name="pdp-6-monitor-manual">{{cite web |url=http://bitsavers.trailing-edge.com/pdf/dec/pdp6/DEC-6-0-EX-SYS-UM-IP-PRE00_Multiprogramming_System_Manual_1965.pdf |title=PDP-6 Multiprogramming System Manual |page=43 |publisher=[[Digital Equipment Corporation]] (DEC) |date=1965 |access-date=July 10, 2014 |archive-url=https://web.archive.org/web/20140714140253/http://bitsavers.trailing-edge.com/pdf/dec/pdp6/DEC-6-0-EX-SYS-UM-IP-PRE00_Multiprogramming_System_Manual_1965.pdf |archive-date=July 14, 2014 |url-status=live }}</ref><ref name="pdp-10-monitor-manual">{{cite web |url=http://bitsavers.org/pdf/dec/pdp10/1970_PDP-10_Ref/1970PDP10Ref_Part3.pdf |title=PDP-10 Reference Handbook, Book 3, Communicating with the Monitor |at=p. 5-5 |publisher=[[Digital Equipment Corporation]] (DEC) |date=1969 |access-date=July 10, 2014 |archive-url=https://web.archive.org/web/20111115083418/http://www.bitsavers.org/pdf/dec/pdp10/1970_PDP-10_Ref/1970PDP10Ref_Part3.pdf |archive-date=November 15, 2011 |url-status=live }}</ref> Because of this, DEC video terminals (by default) sent the DEL character for the key marked "Backspace" while the separate key marked "Delete" sent an [[escape sequence]]; many other competing terminals sent a BS character for the backspace key.
 
The early Unix tty drivers, unlike some modern implementations, allowed only one character to be set to erase the previous character in canonical input processing (where a very simple line editor is available); this could be set to BS ''or'' DEL, but not both, resulting in recurring situations of ambiguity where users had to decide depending on what terminal they were using ([[Shell (computing)|shells]] that allow line editing, such as [[KornShell|ksh]], [[Bash (Unix shell)|bash]], and [[Z shell|zsh]], understand both). The assumption that no key sent a BS character allowed Ctrl+H to be used for other purposes, such as the "help" prefix command in [[GNU Emacs]].<ref>{{cite web|url=https://www.gnu.org/software/emacs/manual/html_node/emacs/Help.html|title=Help - GNU Emacs Manual|access-date=July 11, 2018|archive-url=https://web.archive.org/web/20180711223750/https://www.gnu.org/software/emacs/manual/html_node/emacs/Help.html|archive-date=July 11, 2018|url-status=live}}</ref>
 
In many terminal emulators, printing BS would cause the cursor to move back one column (going back to end of previous line if reached the start of line) but not rubbing out any character, while printing DEL would rubout the character (wide characters will be erased as a whole) at current position then move back the cursor(will not move past the start of line). This feature may be disabled if such a setting exists.
 
====Escape====
Many more of the control characters have been assigned meanings quite different from their original ones. The "escape" character (ESC, code 27), for example, was intended originally to allow sending of other control characters as literals instead of invoking their meaning, an "escape sequence". This is the same meaning of "escape" encountered in URL encodings, [[C (programming language)|C language]] strings, and other systems where certain characters have a reserved meaning. Over time this interpretation has been co-opted and has eventually been changed.
 
In modern usage, an ESC sent ''to'' the terminal usually indicates the start of a command sequence, which can be used to address the cursor, scroll a region, set/query various terminal properties, and more. They are usually in the form of a so-called "[[ANSI escape code]]" (often starting with a "[[Control Sequence Introducer]]", "CSI", "{{Mono|ESC [}}") from ECMA-48 (1972) and its successors. Some escape sequences do not have introducers, like the [[VT100]] full reset command "{{Mono|ESC c}}". <ref>{{cite web|url=https://invisible-island.net/xterm/ctlseqs/ctlseqs.html|title=XTerm Control Sequences|access-date=January 17, 2024}}</ref>
 
In contrast, an ESC read ''from'' the terminal is most often used as an [[out-of-band data|out-of-band]] character used to terminate an operation or special mode, as in the [[Text Editor and Corrector|TECO]] and [[Vi (text editor)|vi]] [[text editor]]s. In [[graphical user interface]] (GUI) and [[window (computing)|windowing]] systems, ESC generally causes an application to abort its current operation or to [[exit (system call)|exit]] (terminate) altogether.
Line 283:
The inherent ambiguity of many control characters, combined with their historical usage, created problems when transferring "plain text" files between systems. The best example of this is the [[newline]] problem on various [[operating system]]s. Teletype machines required that a line of text be terminated with both "carriage return" (which moves the printhead to the beginning of the line) and "line feed" (which advances the paper one line without moving the printhead). The name "carriage return" comes from the fact that on a manual [[typewriter]] the carriage holding the paper moves while the typebars that strike the ribbon remain stationary. The entire carriage had to be pushed (returned) to the right in order to position the paper for the next line.
 
DEC operating systems ([[OS/8]], [[RT-11]], [[RSX-11]], [[RSTS/E|RSTS]], [[TOPS-10]], etc.) used both characters to mark the end of a line so that the console device (originally Teletype machines) would work. By the time so-called "glass TTYs" (later called CRTs or "dumb terminals") came along, the convention was so well established that [[backward compatibility]] necessitated continuing to follow it. When [[Gary Kildall]] created [[CP/M]], he was inspired by some of the command line interface conventions used in DEC's RT-11 operating system.
 
Until the introduction of PC DOS in 1981, [[IBM]] had no influence in this because their 1970s operating systems used EBCDIC encoding instead of ASCII, and they were oriented toward punch-card input and line printer output on which the concept of "carriage return" was meaningless. IBM's PC DOS (also marketed as [[MS-DOS]] by Microsoft) inherited the convention by virtue of being loosely based on CP/M,<ref>{{cite web|url=http://dosmandrivel.blogspot.com/2007/08/is-dos-rip-off-of-cpm.html|title=Is DOS a Rip-Off of CP/M?|author=Tim Paterson|date=August 8, 2007|website=DosMan Drivel|author-link=Tim Paterson|access-date=April 19, 2018|archive-url=https://web.archive.org/web/20180420075137/http://dosmandrivel.blogspot.com/2007/08/is-dos-rip-off-of-cpm.html|archive-date=April 20, 2018|url-status=live}}</ref> and [[Windows]] in turn inherited it from MS-DOS.
 
Requiring two characters to mark the end of a line introduces unnecessary complexity and ambiguity as to how to interpret each character when encountered by itself. To simplify matters, [[plain text]] data streams, including files, on [[Multics]] used line feed (LF) alone as a line terminator.<ref>{{cite conference |url=http://www.multicians.org/jhs-jfo-terminals.pdf |title=Technical and human engineering problems in connecting terminals to a time-sharing system |author-last1=Ossanna |author-first1=J. F. |author-link1=Joe Ossanna |author-last2=Saltzer |author-first2=J. H. |author-link2=Jerry Saltzer |date=November 17–19, 1970 |publisher=[[AFIPS]] Press |book-title=Proceedings of the November 17–19, 1970, [[Fall Joint Computer Conference]] (FJCC) |pages=355–362 |quote=Using a "new-line" function (combined carriage-return and line-feed) is simpler for both man and machine than requiring both functions for starting a new line; the American National Standard X3.4-1968 permits the line-feed code to carry the new-line meaning. |access-date=January 29, 2013 |archive-url=https://web.archive.org/web/20120819085101/http://www.multicians.org/jhs-jfo-terminals.pdf |archive-date=August 19, 2012 |url-status=live }}</ref>{{rp|357}} The tty driver would handle the LF to CRLF conversion on output so files can be directly printed to terminal, and NL (newline) ifis often used to refer to CRLF in [[UNIX]] documents. [[Unix]] and [[Unix-like]] systems, and [[Amiga]] systems, adopted this convention from Multics. On the other hand, the original [[Macintosh OS]], [[Apple DOS]], and [[ProDOS]] used carriage return (CR) alone as a line terminator; however, since Apple later replaced these obsolete operating systems with thetheir Unix-based [[macOS]] (formerly named OS X) operating system, they now use line feed (LF) as well. The Radio Shack [[TRS-80]] also used a lone CR to terminate lines.
 
Computers attached to the [[ARPANET]] included machines running operating systems such as TOPS-10 and [[TENEX (operating system)|TENEX]] using CR-LF line endings; machines running operating systems such as Multics using LF line endings; and machines running operating systems such as [[OS/360]] that represented lines as a character count followed by the characters of the line and which used EBCDIC rather than ASCII encoding. The [[Telnet]] protocol defined an ASCII "[[Network Virtual Terminal]]" (NVT), so that connections between hosts with different line-ending conventions and character sets could be supported by transmitting a standard text format over the network. Telnet used ASCII along with CR-LF line endings, and software using other conventions would translate between the local conventions and the NVT.<ref name="RFC-158">{{cite IETF |title=TELNET Protocol |rfc=158 |pages=4–5 |author-first=T. |author-last=O'Sullivan |date=1971-05-19 |publisher=[[Internet Engineering Task Force]] (IETF) |access-date=2013-01-28}}</ref> The [[File Transfer Protocol]] adopted the Telnet protocol, including use of the Network Virtual Terminal, for use when transmitting commands and transferring data in the default ASCII mode.<ref name="RFC-542">{{cite IETF |title=File Transfer Protocol |rfc=542 |author-first=Nancy J. |author-last=Neigus |date=1973-08-12 |publisher=[[Internet Engineering Task Force]] (IETF) |access-date=2013-01-28}}</ref><ref name="RFC-765">{{cite IETF |title=File Transfer Protocol |rfc=765 |author-first=Jon |author-last=Postel |author-link=Jon Postel |date=June 1980 |publisher=[[Internet Engineering Task Force]] (IETF) |access-date=2013-01-28}}</ref> This adds complexity to implementations of those protocols, and to other network protocols, such as those used for E-mail and the World Wide Web, on systems not using the NVT's CR-LF line-ending convention.<ref>{{cite web |url=https://www.mercurial-scm.org/wiki/EOLTranslationPlan |title=EOL translation plan for Mercurial |publisher=Mercurial |access-date=2017-06-24 |archive-url=https://web.archive.org/web/20160616235536/https://www.mercurial-scm.org/wiki/EOLTranslationPlan |archive-date=June 16, 2016 |url-status=live }}</ref><ref>{{cite web |title=Bare LFs in SMTP |url=http://cr.yp.to/docs/smtplf.html |author-first=Daniel J. |author-last=Bernstein |author-link=Daniel J. Bernstein |access-date=2013-01-28 |archive-url=https://web.archive.org/web/20111029013105/http://cr.yp.to/docs/smtplf.html |archive-date=October 29, 2011 |url-status=live }}</ref>
Line 650:
:<code>{ a[i] = '\n'; }</code>
 
[[C trigraph]]s were created to solve this problem for [[ANSI C]], although their late introduction and inconsistent implementation in compilers limited their use. Many programmers kept their computers on US-ASCII, so plain-text in Swedish, German etc. (for example, in e-mail or [[Usenet]]) contained "{, }" and similar variants in the middle of words, something those programmers got used to. For example, a Swedish programmer mailing another programmer asking if they should go for lunch, could get "N{ jag har sm|rg}sar" as the answer, which should be "Nä jag har smörgåsar" meaning "No I've got sandwiches".
 
In Japan and Korea, still {{As of|2021|alt=as of the 2020s|post=,|df=US}} a variation of ASCII is used, in which the [[backslash]] (5C hex) is rendered as ¥ (a [[Yen sign]], in Japan) or ₩ (a [[Won sign]], in Korea). This means that, for example, the file path C:\Users\Smith is shown as C:¥Users¥Smith (in Japan) or C:₩Users₩Smith (in Korea).
Line 659:
{{Main|Extended ASCII}}{{See also|ISO/IEC 8859|UTF-8}}
<!-- to be mentioned [[USASCII-8]] -->
Eventually, as 8-, [[16-bit computing|16-]], and [[32-bit computing|32-bit]] (and later [[64-bit computing|64-bit]]) computers began to replace [[12-bit computing|12-]], [[18-bit computing|18-]], and [[36-bit computing|36-bit]] computers as the norm, it became common to use an 8-bit byte to store each character in memory, providing an opportunity for extended, 8-bit relatives of ASCII. In most cases these developed as true extensions of ASCII, leaving the original character-mapping intact, but adding additional character definitions after the first 128 (i.e., 7-bit) characters. ASCII itself remained a seven-bit code: the term "extended ASCII" has no official status.
 
For some countries, 8-bit extensions of ASCII were developed that included support for characters used in local languages; for example, [[ISCII]] for India and [[VISCII]] for Vietnam. [[Kaypro]] [[CP/M]] computers used the "upper" 128 characters for the Greek alphabet.{{citation needed|date=November 2023}}
Line 669:
IBM defined [[code page 437]] for the [[IBM PC]], replacing the control characters with graphic symbols such as [[Emoticon|smiley faces]], and mapping additional graphic characters to the upper 128 positions.<ref>{{cite book |url=http://www.bitsavers.org/pdf/ibm/pc/pc/6025008_PC_Technical_Reference_Aug81.pdf |title=Technical Reference |at=Appendix C. Of Characters Keystrokes and Color |edition=First |date=August 1981 |series=Personal Computer Hardware Reference Library |publisher=IBM}}</ref> [[Digital Equipment Corporation]] developed the [[Multinational Character Set]] (DEC-MCS) for use in the popular [[VT220]] [[computer terminal|terminal]] as one of the first extensions designed more for international languages than for block graphics. [[Apple Inc.|Apple]] defined [[Mac OS Roman]] for the Macintosh and [[Adobe Inc.|Adobe]] defined the [[PostScript Standard Encoding]] for [[PostScript]]; both sets contained "international" letters, typographic symbols and punctuation marks instead of graphics, more like modern character sets.
 
The [[ISO/IEC 8859]] standard (derived from the DEC-MCS) provided a standard that most systems copied (or at least were based on, when not copied exactly). A popular further extension designed by Microsoft, [[Windows-1252]] (often mislabeled as [[ISO-8859-1]]), added the typographic punctuation marks needed for traditional text printing. ISO-8859-1, Windows-1252, and the original 7-bit ASCII were the most common character encodingsencoding methods on the [[World Wide Web]] until 2008, when [[UTF-8]] overtook them.<ref name="UTF-8_2008"/>
 
[[ISO/IEC 4873]] introduced 32 additional control codes defined in the 80–9F [[hexadecimal]] range, as part of extending the 7-bit ASCII encoding to become an 8-bit system.<ref name="Unicode-5.0_2006">{{cite book |author=The Unicode Consortium |editor-first=Julie D. |editor-last=Allen |title=The Unicode standard, Version 5.0 |date=2006-10-27 |publisher=[[Addison-Wesley Professional]] |location=Upper Saddle River, New Jersey, US |isbn=978-0-321-48091-0 |chapter-url=http://unicode.org/book/ch13.pdf |archive-url=https://ghostarchive.org/archive/20221009/http://unicode.org/book/ch13.pdf |archive-date=2022-10-09 |url-status=live |access-date=2015-03-13 |chapter=Chapter 13: Special Areas and Format Characters |page=314}}</ref>
Line 682:
{{cols|colwidth=30em}}
* [[3568 ASCII]] – an asteroid named after the character encoding
* {{anliannotated link|Alt codes}}
* {{anliannotated link|ASCII 8}}
* {{anliannotated link|ASCII art}}
* {{anliannotated link|ASCII Ribbon Campaign}}
* [[Basic Latin (Unicode block)]] – ASCII as a subset of Unicode
* {{anliannotated link|Extended ASCII}}
* [[HTML decimal character rendering]]
* [[Jargon File]] – a glossary of computer programmer slang which includes a list of common slang names for ASCII characters
Line 732:
==========(PLEASE NOTE)============ -->
* {{cite web |title=C0 Controls and Basic Latin – Range: 0000–007F |work=The Unicode Standard 8.0 |date=2015 |orig-year=1991 |publisher=[[Unicode, Inc.]] |url=https://www.unicode.org/charts/PDF/U0000.pdf |access-date=2016-05-26 |url-status=live |archive-url=https://web.archive.org/web/20160526182105/http://www.unicode.org/charts/PDF/U0000.pdf |archive-date=2016-05-26}}
 
 
{{Character encodings|state=collapsed}}
{{Authority control}}
 
[[Category:ASCII| ]]
[[Category:Computer-related introductions in 1963]]