Character is a data type used to represent a single written symbol or text unit.
The exact meaning of “character” depends on the language and encoding model. It may mean a byte, a Unicode code point, or a user-perceived character.
For example:
- In C,
charis commonly a one-byte integer type. - In Java,
charis a 16-bit UTF-16 code unit. - In Go,
runeis an alias forint32and represents a Unicode code point.
Characters are closely related to strings, but a string is usually a sequence of characters, bytes, code points, or code units.
Unicode makes character handling more complex because a single user-perceived character can be made from multiple code points.
Anki
id: character-definition deck: Computer Science::Data Types tags: data-types character unicode
Q: What is a character data type? A: A character data type represents a single written symbol or text unit, depending on the language’s encoding model.
id: character-unicode-complexity deck: Computer Science::Data Types tags: data-types character unicode
Q: Why can Unicode make character handling complex? A: A single user-perceived character can be made from multiple code points.