HOME

TheInfoList




In
computer A computer is a machine that can be programmed to Execution (computing), carry out sequences of arithmetic or logical operations automatically. Modern computers can perform generic sets of operations known as Computer program, programs. These ...

computer
and machine-based
telecommunication Telecommunication is the transmission of information by various types of technologies over wire A wire is a single usually cylindrical A cylinder (from Greek Greek may refer to: Greece Anything of, from, or related to Greece Gr ...
s terminology, a character is a unit of
information Information is processed, organised and structured data Data (; ) are individual facts A fact is something that is truth, true. The usual test for a statement of fact is verifiability—that is whether it can be demonstrated to c ...

information
that roughly corresponds to a
grapheme In linguistics Linguistics is the scientific study of language A language is a structured system of communication used by humans, including speech (spoken language), gestures (Signed language, sign language) and writing. Most langu ...

grapheme
, grapheme-like unit, or
symbol A symbol is a mark, sign, or word In linguistics, a word of a spoken language can be defined as the smallest sequence of phonemes that can be uttered in isolation with semantic, objective or pragmatics, practical meaning (linguistics), m ...

symbol
, such as in an
alphabet An alphabet is a standardized set of basic written symbols A symbol is a mark, sign, or word In linguistics, a word of a spoken language can be defined as the smallest sequence of phonemes that can be uttered in isolation with semanti ...

alphabet
or
syllabary In the linguistic Linguistics is the science, scientific study of language. It encompasses the analysis of every aspect of language, as well as the methods for studying and modeling them. The traditional areas of linguistic analysis includ ...
in the
written Writing is a medium of human communication Communication (from Latin ''communicare'', meaning "to share") is the act of developing Semantics, meaning among Subject (philosophy), entities or Organization, groups through the use of sufficien ...
form of a
natural language In neuropsychology Neuropsychology is a branch of psychology. It is concerned with how a person's cognition and behavior are related to the brain and the rest of the nervous system. Professionals in this branch of psychology often focus on ...
. Examples of characters include
letters Letter, letters, or literature may refer to: Characters typeface * Letter (alphabet) A letter is a segmental symbol A symbol is a mark, sign, or word that indicates, signifies, or is understood as representing an idea, Object (philosophy ...
,
numerical digit A numerical digit (often shortened to just digit) is a single symbol used alone (such as "2") or in combinations (such as "25"), to represent number A number is a mathematical object A mathematical object is an abstract concept arising in mat ...
s, common
punctuation Punctuation (or sometimes interpunction) is the use of spacing, conventional signs (called punctuation marks), and certain typographical devices as aids to the understanding and correct reading of written text, whether read silently or aloud. An ...
marks (such as "." or "-"), and
whitespace White space or whitespace may refer to: Technology * Whitespace character, Whitespace characters, characters in computing that represent horizontal or vertical space * White spaces (radio), allocated but locally unused radio frequencies * TV White ...
. The concept also includes
control character In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and sof ...
s, which do not correspond to visible symbols but rather to instructions to format or process the text. Examples of control characters include
carriage return A carriage return, sometimes known as a cartridge return and often shortened to CR, or return, is a control character In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It inclu ...
or , as well as instructions to
printer Printers may be: Technology * Printer (publishing) In publishing, printers are both companies A company, abbreviated as co., is a Legal personality, legal entity representing an association of people, whether Natural person, natural, Legal ...
s or other devices that display or otherwise process text. Characters are typically combined into
string String or strings may refer to: *String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects Arts, entertainment, and media Films * Strings (1991 film), ''Strings'' (1991 fil ...
s. Historically, the term ''character'' was also used to just denote a specific number of contiguous
bit The bit is a basic unit of information in computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithm of an algorithm (Euclid's algo ...
s. While a character is most commonly assumed to refer to 8 bits (one
byte The byte is a unit of digital information that most commonly consists of eight bit The bit is a basic unit of information in computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It ...
) today, other definitions, like 6-bit character code was once popular (using only
upper case Letter case is the distinction between the letters Letter, letters, or literature may refer to: Characters typeface * Letter (alphabet) A letter is a segmental symbol A symbol is a mark, sign, or word that indicates, signifies, or i ...
, while enough bits to also represent
lower case Letter case is the distinction between the letters Letter, letters, or literature may refer to: Characters typeface * Letter (alphabet) A letter is a segmental symbol A symbol is a mark, sign, or word that indicates, signifies, or ...
, not with numbers and punctuation allowed for), and even 5-bit Baudot code have been used in the past as well, and while the term has also been applied to 4 bits with only 16 possible values, it wasn't meant to, nor can, represent the full English alphabet. See also
Universal Character Set characters The Unicode Consortium (UC) and the International Organisation for Standardisation (ISO) collaborate on the Universal Character Set (UCS). The UCS is an international standard to map characters used in natural language, mathematics, music, and ...
, where 8 bits are not enough to represent, while all can be represented with one or more 8-bit
code unit In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and softw ...
s with
UTF-8 UTF-8 is a variable-width character encoding Character encoding is the process of assigning numbers to Graphics, graphical character (computing), characters, especially the written characters of Language, human language, allowing them to be ...
.


Encoding

Computers and communication equipment represent characters using a
character encoding Character encoding is the process of assigning numbers to graphical Graphics (from Greek Greek may refer to: Greece Anything of, from, or related to Greece Greece ( el, Ελλάδα, , ), officially the Hellenic Republic, is a country ...
that assigns each character to something an
integer An integer (from the Latin Latin (, or , ) is a classical language A classical language is a language A language is a structured system of communication Communication (from Latin ''communicare'', meaning "to share" or "to ...
quantity represented by a sequence of digits, typically that can be stored or transmitted through a
network Network, networking and networked may refer to: Science and technology * Network theory, the study of graphs as a representation of relations between discrete objects * Network science, an academic field that studies complex networks Mathematics ...
. Two examples of usual encodings are
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the stu ...
and the
UTF-8 UTF-8 is a variable-width character encoding Character encoding is the process of assigning numbers to Graphics, graphical character (computing), characters, especially the written characters of Language, human language, allowing them to be ...
encoding for
Unicode Unicode, formally the Unicode Standard, is an information technology Technical standard, standard for the consistent character encoding, encoding, representation, and handling of Character (computing), text expressed in most of the world's wri ...

Unicode
. While most character encodings map characters to numbers and/or bit sequences,
Morse code Morse code is a method used in telecommunication Telecommunication is the transmission of information by various types of technologies over wire A wire is a single usually cylindrical A cylinder (from Greek Greek may refer to: ...
instead represents characters using a series of electrical impulses of varying length.


Terminology

Historically, the term ''character'' has been widely used by industry professionals to refer to an ''encoded character'', often as defined by the programming language or
API In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and soft ...
. Likewise, ''character set'' has been widely used to refer to a specific repertoire of characters that have been mapped to specific bit sequences or numerical codes. The term
glyph The term glyph is used in typography Typography is the art and technique of arranging type to make written language A written language is the representation of a spoken or gestural language A language is a structured system o ...
is used to describe a particular visual appearance of a character. Many computer
font In metal A metal (from Greek Greek may refer to: Greece Anything of, from, or related to Greece Greece ( el, Ελλάδα, , ), officially the Hellenic Republic, is a country located in Southeast Europe. Its population is approxim ...

font
s consist of glyphs that are indexed by the numerical code of the corresponding character. With the advent and widespread acceptance of Unicode and bit-agnostic ''coded character sets'', a character is increasingly being seen as a unit of
information Information is processed, organised and structured data Data (; ) are individual facts A fact is something that is truth, true. The usual test for a statement of fact is verifiability—that is whether it can be demonstrated to c ...

information
, independent of any particular visual manifestation. The ISO/IEC 10646 (Unicode) International Standard defines ''character'', or ''abstract character'' as "a member of a set of elements used for the organisation, control, or representation of data". Unicode's definition supplements this with explanatory notes that encourage the reader to differentiate between characters, graphemes, and glyphs, among other things. Such differentiation is an instance of the wider theme of the
separation of presentation and content Separation of content and presentation (or separation of content and style) is the separation of concerns In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its compu ...
. For example, the
aleph Aleph (or alef or alif, transliterated ʾ) is the first letter Letter, letters, or literature may refer to: Characters typeface * Letter (alphabet) A letter is a segmental symbol A symbol is a mark, sign, or word that indicates, sig ...
("א") is often used by mathematicians to denote certain kinds of
infinity Infinity is that which is boundless, endless, or larger than any number A number is a mathematical object A mathematical object is an abstract concept arising in mathematics. In the usual language of mathematics, an ''object'' is anything ...
(ℵ), but it is also used in ordinary Hebrew text. In Unicode, these two uses are considered different characters, and have two different Unicode numerical identifiers ("
code point In character encoding In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardw ...
s"), though they may be rendered identically. Conversely, the
Chinese Chinese can refer to: * Something related to China China, officially the People's Republic of China (PRC), is a country in East Asia. It is the List of countries and dependencies by population, world's most populous country, with a populat ...
logogram In a written language A written language is the representation of a spoken or gestural language A language is a structured system of communication used by humans, including speech (spoken language), gestures (Signed language, sign lang ...
for water ("水") may have a slightly different appearance in
Japanese Japanese may refer to: * Something from or related to Japan Japan ( ja, 日本, or , and formally ) is an island country An island country or an island nation is a country A country is a distinct territory, territorial body or ...
texts than it does in Chinese texts, and local
typeface A typeface is the design of lettering Lettering is an umbrella term In linguistics Linguistics is the science, scientific study of language. It encompasses the analysis of every aspect of language, as well as the methods for studying ...

typeface
s may reflect this. But nonetheless in Unicode they are considered the same character, and share the same code point. The Unicode standard also differentiates between these abstract characters and ''coded characters'' or ''encoded characters'' that have been paired with numeric codes that facilitate their representation in computers.


Combining character

The
combining character In digital typography, combining characters are Character (computing), characters that are intended to modify other characters. The most common combining characters in the Latin script are the combining diacritic, diacritical marks (including co ...
is also addressed by Unicode. For instance, Unicode allocates a code point to each of * 'i ' (U+0069), * the combining diaeresis (U+0308), and * 'ï' (U+00EF). This makes it possible to code the middle character of the word 'naïve' either as a single character 'ï' or as a combination of the character with the combining diaeresis: (U+0069 LATIN SMALL LETTER I + U+0308 COMBINING DIAERESIS); this is also rendered as 'ï '. These are considered canonically equivalent by the Unicode standard.


char

A ''char'' in the
C programming language C (, as in the letter ''c'') is a general-purpose, procedural computer programming language A programming language is a formal language comprising a Instruction set architecture, set of instructions that produce various kinds of Input/outp ...
is a data type with the size of exactly one
byte The byte is a unit of digital information that most commonly consists of eight bit The bit is a basic unit of information in computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It ...
, which in turn is defined to be large enough to contain any member of the “basic execution character set”. The exact number of bits can be checked via macro. By far the most common size is 8 bits, and the POSIX standard ''requires'' it to be 8 bits. In newer C standards ''char'' is required to hold
UTF-8 UTF-8 is a variable-width character encoding Character encoding is the process of assigning numbers to Graphics, graphical character (computing), characters, especially the written characters of Language, human language, allowing them to be ...
code units which requires a minimum size of 8 bits. A
Unicode Unicode, formally the Unicode Standard, is an information technology Technical standard, standard for the consistent character encoding, encoding, representation, and handling of Character (computing), text expressed in most of the world's wri ...

Unicode
code point may require as many as 21 bits. This will not fit in a ''char'' on most systems, so more than one is used for some of them, as in the variable-length encoding
UTF-8 UTF-8 is a variable-width character encoding Character encoding is the process of assigning numbers to Graphics, graphical character (computing), characters, especially the written characters of Language, human language, allowing them to be ...
where each code point takes 1 to 4 bytes. Furthermore, a "character" may require more than one code point (for instance with
combining characters In digital typography, combining characters are Character (computing), characters that are intended to modify other characters. The most common combining characters in the Latin script are the combining diacritic, diacritical marks (including co ...
), depending on what is meant by the word "character". The fact that a character was historically stored in a single byte led to the two terms ("char" and "character") being used interchangeably in most documentation. This often makes the documentation confusing or misleading when multibyte encodings such as UTF-8 are used, and has led to inefficient and incorrect implementations of string manipulation functions (such as computing the "length" of a string as a count of code units rather than bytes). Modern POSIX documentation attempts to fix this, defining "character" as a sequence of one or more bytes representing a single graphic symbol or control code, and attempts to use "byte" when referring to char data. However it still contains errors such as defining an array of ''char'' as a ''character array'' (rather than a ''byte array''). Unicode can also be stored in strings made up of code units that are larger than ''char''. These are called " wide characters". The original C type was called ''''. Due to some platforms defining ''wchar_t'' as 16 bits and others defining it as 32 bits, recent versions have added ''char16_t'', ''char32_t''. Even then the objects being stored might not be characters, for instance the variable-length
UTF-16 UTF-16 ( Transformation Format) is a capable of encoding all 1,112,064 valid character s of Unicode (in fact this number of code points is dictated by the design of UTF-16). The encoding is , as code points are encoded with one or two 16-bit ''c ...
is often stored in arrays of ''char16_t''. Other languages also have a ''char'' type. Some such as
C++ C++ () is a general-purpose programming language In computer software, a general-purpose programming language is a programming language dedicated to a general-purpose, designed to be used for writing software in a wide variety of application ...

C++
use 8 bits like C. Others such as
Java Java ( id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 147.7 million people, Java is the world's List of ...
use 16 bits for ''char'' in order to represent UTF-16 values.


See also

* Character literal *
Character (symbol)A character is a semiotic sign (semiotic), sign or symbol, or a glyph typically a letter (alphabet), letter, a numerical digit, an ideogram, a hieroglyph, a punctuation mark or another typography, typographic mark. History The Ancient Greek word ( ...
*
Fill character In computer terminology, a fill character is a character Character(s) may refer to: Arts, entertainment, and media Literature * ''Character'' (novel), a 1936 Dutch novel by Ferdinand Bordewijk * ''Characters'' (Theophrastus), a classical Gre ...
*
Combining character In digital typography, combining characters are Character (computing), characters that are intended to modify other characters. The most common combining characters in the Latin script are the combining diacritic, diacritical marks (including co ...
*
Universal Character Set characters The Unicode Consortium (UC) and the International Organisation for Standardisation (ISO) collaborate on the Universal Character Set (UCS). The UCS is an international standard to map characters used in natural language, mathematics, music, and ...
*
Homoglyph In orthography An orthography is a set of conventions for writing Writing is a medium of human communication that involves the representation of a language with written symbols. Writing systems are not themselves human languages (with the ...


References


External links


Characters: A Brief Introduction
by The Linux Information Project (LINFO)
ISO/IEC TR 15285:1998
summarizes the ISO/IEC's character model, focusing on terminology definitions and differentiating between characters and glyphs {{Authority control Character encoding Data types Digital typography Primitive types