In computer data, a substitute character (␚) is a
control character that is used to pad transmitted data in order to send it in blocks of fixed size, or to stand in place of a character that is recognized to be invalid, erroneous or unrepresentable on a given device. It is also used as an escape sequence in some
programming language
A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language.
The description of a programming l ...
s.
In the
ASCII character set, this character is encoded by the number 26 (
hex
Hex or HEX may refer to:
Magic
* Hex, a curse or supposed real and potentially supernaturally realized malicious wish
* Hex sign, a barn decoration originating in Pennsylvania Dutch regions of the United States
* Hex work, a Pennsylvania Dutch ...
). Standard
keyboards transmit this code when the
and keys are pressed simultaneously (, often documented by convention as '')''.
Unicode
Unicode, formally The Unicode Standard,The formal version reference is is an information technology standard for the consistent encoding, representation, and handling of text expressed in most of the world's writing systems. The standard, ...
inherits this character from ASCII, but recommends that the
replacement character (�, U+FFFD) be used instead to represent un-decodable inputs, when the output encoding is compatible with it.
Uses
End of file
Historically, under
PDP-6
The PDP-6, short for Programmed Data Processor model 6, is a computer developed by Digital Equipment Corporation (DEC) during 1963 and first delivered in the summer of 1964.
It was an expansion of DEC's existing 18-bit systems to use a 36-bit ...
monitor,
RT-11,
VMS #REDIRECT VMS
{{redirect category shell, {{R from other capitalisation{{R from ambiguous page ...
, and
TOPS-10
TOPS-10 System (''Timesharing / Total Operating System-10'') is a discontinued operating system from Digital Equipment Corporation (DEC) for the PDP-10 (or DECsystem-10) mainframe computer family. Launched in 1967, TOPS-10 evolved from the earlier ...
,
and in early PC
CP/M 1 and 2
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
s (and derivatives like
MP/M) it was necessary to explicitly mark the
end of a file (EOF) because the native
filesystem
In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one larg ...
could not record the exact file size by itself; files were allocated in extents (records) of a fixed size, typically leaving some allocated but unused space at the end of each file.
This extra space was filled with
16 (
hex
Hex or HEX may refer to:
Magic
* Hex, a curse or supposed real and potentially supernaturally realized malicious wish
* Hex sign, a barn decoration originating in Pennsylvania Dutch regions of the United States
* Hex work, a Pennsylvania Dutch ...
) characters under CP/M. The extended CP/M filesystems used by CP/M 3 and higher (and derivatives like
Concurrent CP/M,
Concurrent DOS, and
DOS Plus) did support byte-granular files,
so this was no longer a requirement, but it remained as a convention (especially for
text file
A text file (sometimes spelled textfile; an old alternative name is flatfile) is a kind of computer file that is structured as a sequence of lines of electronic text. A text file exists stored as data within a computer file system. In operat ...
s) in order to ensure backward compatibility.
In
CP/M,
86-DOS,
MS-DOS
MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few oper ...
,
PC DOS,
DR-DOS
DR-DOS (written as DR DOS, without a hyphen, in versions up to and including 6.0) is a disk operating system for IBM PC compatibles. Upon its introduction in 1988, it was the first DOS attempting to be compatible with IBM PC DOS and MS-DO ...
, and their various derivatives, the SUB character was also used to indicate the end of a character stream, and thereby used to terminate user input in an interactive
command line window (and as such, often used to finish console input redirection, e.g. as instigated by the command
COPY CON: TYPEDTXT.TXT).
While no longer technically required to indicate the end of a file, as of 2017 many text editors and program languages still support this convention, or can be configured to insert this character at the end of a file when editing, or at least properly cope with them in text files. In such cases, it is often termed a "soft" EOF, as it does not necessarily represent the physical end of the file, but is more a marker indicating that "there is no useful data beyond this point". In reality, more data may exist beyond this character up to the actual end of the data in the file system, thus it can be used to hide file content when the file is entered at the console or opened in editors. Many file format standards (e.g.
PNG or
GIF) include the SUB character in their headers to perform precisely this function. Some modern text file formats (e.g.
CSV-1203) still recommend a trailing EOF character to be appended as the last character in the file. However, typing does not embed an EOF character into a file in either
DOS or
Windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for ...
, nor do the
APIs
Apis or APIS may refer to:
* Apis (deity), an ancient Egyptian god
* Apis (Greek mythology), several different figures in Greek mythology
* Apis (city), an ancient seaport town on the northern coast of Africa
**Kom el-Hisn, a different Egyptian ci ...
of those systems use the character to denote the actual end of a file.
Some programming languages (e.g.
Visual Basic Visual Basic is a name for a family of programming languages from Microsoft. It may refer to:
* Visual Basic .NET (now simply referred to as "Visual Basic"), the current version of Visual Basic launched in 2002 which runs on .NET
* Visual Basic (c ...
) will not read past a "soft" EOF when using the built-in text file reading primitives (INPUT, LINE INPUT etc.), and alternate methods must be adopted, e.g. opening the file in binary mode or using the File System Object to progress beyond it.
Character 26 was used to mark "End of file" even though ASCII calls this character Substitute, and has other characters to indicate "End of file". Number 28 which is called "
File Separator" has also been used for similar purposes.
Other uses
In
Unix
Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
-like operating systems, this character is typically used in
shells as a way for the user to
suspend the currently executing interactive process.
The suspended process can then be resumed in ''foreground'' (interactive) mode, or be made to resume execution in ''
background'' mode, or be
terminated. When entered by a user at their
computer terminal
A computer terminal is an electronic or electromechanical hardware device that can be used for entering data into, and transcribing data from, a computer or a computing system. The teletype was an example of an early-day hard-copy terminal a ...
, the currently running foreground process is sent a "terminal stop" (
SIGTSTP
In Unix and Unix-like operating systems, job control refers to control of jobs by a shell, especially interactively, where a "job" is a shell's representation for a process group. Basic job control features are the suspending, resuming, or termina ...
) signal, which generally causes the process to suspend its execution. The user can later continue the process execution by using the "foreground" command (
fg
) or the "
background" command (
bg
).
The Unicode Security Considerations report
recommends this character as a safe replacement for unmappable characters during character set conversion.
In many GUIs and applications, ( on
macOS
macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac (computer), Mac computers. Within the market of ...
) can be used to
undo
Undo is an interaction technique which is implemented in many computer programs. It erases the last change done to the document, reverting it to an older state. In some more advanced programs, such as graphic processing, undo will negate the las ...
the last action. In many applications, earlier actions than the last one can also be undone by pressing multiple times. was one of a handful of
keyboard sequences chosen by the program designers at
Xerox PARC to control
text editing
A text editor is a type of computer program that edits plain text. Such programs are sometimes known as "notepad" software (e.g. Windows Notepad). Text editors are provided with operating systems and software development packages, and can be us ...
.
Representation
ASCII
ASCII ( ), abbreviated from 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 ...
and
Unicode
Unicode, formally The Unicode Standard,The formal version reference is is an information technology standard for the consistent encoding, representation, and handling of text expressed in most of the world's writing systems. The standard, ...
representation of "substitute":
* Octal code: 32
* Decimal code: 26
* Hexadecimal code: 1A, U+001A
* Mnemonic symbol: SUB
* Binary value: 11010
See also
*
C0 and C1 control codes
The C0 and C1 control code or control character sets define control codes for use in text by computer systems that use ASCII and derivatives of ASCII. The codes represent additional information about the text, such as the position of a curso ...
(
ISO 646)
*
U+FFFD (Unicode replacement character �)
*
Access key
*
Control-C
*
Control-G
*
Control-V
*
Control-X
*
Control-\
*
Keyboard shortcut
computing, a keyboard shortcut also known as hotkey is a series of one or several keys to quickly invoke a software program or perform a preprogrammed action. This action may be part of the standard functionality of the operating system or ...
*
List of file signatures
This is a list of file signatures, data used to identify or verify the content of a file. Such signatures are also known as magic numbers or Magic Bytes.
Many file formats are not intended to be read as text. If such a file is accidentally view ...
* , a symbol (sometimes called by the slang term ''tofu'') used to represent a missing character
**
Noto fonts, a Google project to eliminate missing characters
References
{{reflist, refs=
[{{cite book , title=CP/M 2.0 Interface Guide , chapter=2. Operating System Call Conventions , date=1979 , edition=1 , publisher=]Digital Research
Digital Research, Inc. (DR or DRI) was a company created by Gary Kildall to market and develop his CP/M operating system and related 8-bit, 16-bit and 32-bit systems like MP/M, Concurrent DOS, FlexOS, Multiuser DOS, DOS Plus, DR DOS ...
, location=Pacific Grove, California, USA , page=5 , url=http://bitsavers.org/pdf/digitalResearch/cpm/2.0/CPM_2_0_Interface_Guide_1979.pdf , access-date=2020-02-28 , url-status=live , archive-url=https://web.archive.org/web/20200228175812/http://bitsavers.org/pdf/digitalResearch/cpm/2.0/CPM_2_0_Interface_Guide_1979.pdf , archive-date=2020-02-28 , quote= ..The end of an ASCII
ASCII ( ), abbreviated from 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 ...
file is denoted by a control-Z character (1AH) or a real end of file, returned by the CP/M read operation. Control-Z characters embedded within machine code files (e.g., COM file
A COM file is a type of simple executable file. On the Digital Equipment Corporation (DEC) VAX operating systems of the 1970s, .COM was used as a filename extension for text files containing commands to be issued to the operating system (sim ...
s) are ignored, however, and the end of file condition returned by CP/M is used to terminate read operations. ..} (56 pages)
[{{cite book , title=Osborne CP/M User Guide - For All CP/M Users , chapter=3. CP/M Transient Commands , author-first=Thom , author-last=Hogan , publisher= A. Osborne/McGraw-Hill , date=1982 , edition=2 , location=Berkeley, California, USA , isbn=0-931988-82-9 , pag]
74
, url=https://archive.org/details/osborne-cpm-users-guide_2nd-ed , access-date=2020-02-28 , quote= .. CP/M marks the end of an ASCII
ASCII ( ), abbreviated from 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 ...
file by placing a CONTROL-z character in the file after the last data character. If the file contains an exact multiple of 128 characters, in which case adding the CONTROL-Z would waste 127 characters, CP/M does not do so. Use of the CONTROL-Z character as the end-of-file marker is possible because CONTROL-z is seldom used as data in ASCII files. In a non-ASCII file, however, CONTROL-Z is just as likely to occur as any other character. Therefore, it cannot be used as the end-of-file marker. CP/M uses a different method to mark the end of a non-ASCII file. CP/M assumes it has reached the end of the file when it has read the last record (basic unit of disk space) allocated to the file. The disk directory entry for each file contains a list of the disk records allocated to that file. This method relies on the size of the file, rather than its content, to locate the end of the file. ..
https://archive.org/download/osborne-cpm-users-guide_2nd-ed/OsborneCpmUsersGuideSecondEdition.pdf]
[{{cite book , title=PDP-6 Multiprogramming System Manual , chapter=Table of IO Device Characteristics - Console or Teletypewriters , id=DEC-6-0-EX-SYS-UM-IP-PRE00 , publisher=]Digital Equipment Corporation
Digital Equipment Corporation (DEC ), using the trademark Digital, was a major American company in the computer industry from the 1960s to the 1990s. The company was co-founded by Ken Olsen and Harlan Anderson in 1957. Olsen was president unti ...
(DEC) , publication-place=Maynard, Massachusetts, USA , date=1965 , page=43 , url=http://bitsavers.trailing-edge.com/pdf/dec/pdp6/DEC-6-0-EX-SYS-UM-IP-PRE00_Multiprogramming_System_Manual_1965.pdf , access-date=2014-07-10 , url-status=live , 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=2014-07-14 (1+84+10 pages)
[{{cite book , title=PDP-10 Reference Handbook: Communicating with the Monitor - Time-Sharing Monitors , volume=3 , chapter=5.1.1.1. Device Dependent Functions - Data Modes - Full-Duplex Software A(ASCII) and AL(ASCII Line) , publisher=]Digital Equipment Corporation
Digital Equipment Corporation (DEC ), using the trademark Digital, was a major American company in the computer industry from the 1960s to the 1990s. The company was co-founded by Ken Olsen and Harlan Anderson in 1957. Olsen was president unti ...
(DEC) , date=1969 , pages=5-3 – 5-6 -5 (431), url=http://bitsavers.org/pdf/dec/pdp10/1970_PDP-10_Ref/1970PDP10Ref_Part3.pdf , access-date=2014-07-10 , url-status=live , archive-url=https://web.archive.org/web/20111115083418/http://www.bitsavers.org/pdf/dec/pdp10/1970_PDP-10_Ref/1970PDP10Ref_Part3.pdf , archive-date=2011-11-15 (207 pages)
[{{cite web , title=Keyboard shortcuts for Windows , work=Microsoft Support , publisher=]Microsoft
Microsoft Corporation is an American multinational corporation, multinational technology company, technology corporation producing Software, computer software, consumer electronics, personal computers, and related services headquartered at th ...
, url=http://support.microsoft.com/kb/126449 , access-date=2012-06-02
[{{cite web , author-first=John C. , author-last=Elliott , date=1998 , title=CP/M 1.4 disc formats , url=http://www.seasip.info/Cpm/format14.html , access-date=2021-11-18 , url-status=live , archive-url=https://web.archive.org/web/20201114231913/http://www.seasip.info/Cpm/format14.html , archive-date=2020-11-14]
[{{cite web , author-first=John C. , author-last=Elliott , date=1998 , title=CP/M 2.2 disc formats , url=http://www.seasip.info/Cpm/format22.html , access-date=2021-11-18 , url-status=live , archive-url=https://web.archive.org/web/20201105204828/http://www.seasip.info/Cpm/format22.html , archive-date=2020-11-05]
[{{cite web , author-first=John C. , author-last=Elliott , date=1998 , title=CP/M 3.1 disc formats , url=http://www.seasip.info/Cpm/format31.html , access-date=2021-11-18 , url-status=live , archive-url=https://web.archive.org/web/20211026154048/https://www.seasip.info/Cpm/format31.html , archive-date=2021-10-26]
[{{cite web , author-first=John C. , author-last=Elliott , date=1998 , title=CP/M 4.1 disc formats , url=http://www.seasip.info/Cpm/format41.html , access-date=2021-11-18 , url-status=live , archive-url=https://web.archive.org/web/20201105174304/http://www.seasip.info/Cpm/format41.html , archive-date=2020-11-05]
[{{cite web , title=Quick Reference: Unix Commands , work=IT Connect , publisher=]University of Washington
The University of Washington (UW, simply Washington, or informally U-Dub) is a public research university in Seattle, Washington.
Founded in 1861, Washington is one of the oldest universities on the West Coast; it was established in Seat ...
, url=http://www.washington.edu/computing/unix/unixqr.html , access-date=2012-06-02
[CSV-1203 format specification](_blank)
{{Webarchive, url=http://arquivo.pt/wayback/20160516100434/http://www.mastpoint.com/csv-1203 , date=2016-05-16
[Unicode Security Considerations report](_blank)
/ref>
Further reading
* Federal Standard 1037C
Federal Standard 1037C, titled Telecommunications: Glossary of Telecommunication Terms, is a United States Federal Standard issued by the General Services Administration pursuant to the Federal Property and Administrative Services Act of 1949, ...
Control characters