Unicode input

From Wikipedia, the free encyclopedia

Template:Short description

File:KCharSelect Mathematical Operators.png
The KCharSelect character mapping tool shown displaying a subset of the Unicode Mathematical Operators
File:New Unicode logo.svg
The Unicode logo

Unicode input is a method to encode specific characters that are not directly available on a physical keyboard. Characters can be entered either by selecting them from a display, by typing a certain sequence or a 'chord' of keys on a physical keyboard, or by drawing the symbol by hand on touch-sensitive screen. In contrast to ASCII's 96 element character set (which it contains), Unicode encodes hundreds of thousands of graphemes (characters) from almost all of the world's written languages as well as many other signs and symbols.[1][better source needed]

A comprehensive Unicode input system must provide for a large repertoire of characters, ideally all valid Unicode code points. This is different from a keyboard layout which defines keys and their combinations only for a limited number of characters appropriate for a certain locale. Nevertheless, the latter technique (particularly if an "extended" setting is used) is often adequate to satisfy the needs of most users, most of the time.

Unicode numbers

Characters encoded in Unicode are identified by code points, which are conventionally represented by "U+" followed by four, five or six hexadecimal digits. For example, U+00AE and U+1D310 are the code points for "®" and "𝌐" respectively. Characters in the Basic Multilingual Plane (BMP), containing modern scripts – including many Chinese and Japanese characters – and many symbols, have a 4-digit code. Historic scripts, but also many modern symbols and pictographs (such as emoticons, emojis, playing cards and many CJK characters) have 5-digit codes.

Grapheme availability

An application can display a character only if it can access a computer font which contains a grapheme for that character.[2] Fonts usually have incomplete Unicode coverage; most only contain the graphemes needed to support a few writing systems. However, most modern browsers and other text-processing applications are able to display multilingual content because they perform font substitution, automatically switching to a fallback font when necessary to display characters which are not supported in the current font. Which fonts are used for fallback and the thoroughness of Unicode coverage varies by software and operating system; some software will search for a suitable glyph in all of the installed fonts, others only search within certain fonts.

If an application does not have access to a glyph for a required codepoint in the specified font,[a] the character should be shown as the font's .notdef glyph ⟨􏿮⟩.[3] This often appears as an empty box, ☐ (nicknamed "tofu" based on the shape), a box with an X in it, ☒, a diamond with a question mark, �, or a box with a question mark in it, ⍰.

Techniques

Script error: No such module "Labelled list hatnote".

Extended keyboard mapping

Script error: No such module "labelled list hatnote". Most operating systems support an 'extended keyboard mapping' system setting, which is a facility to increase the repertoire of characters – typically a precomposed character, a typographic symbol or punctuation mark, or other specialist graphemes – beyond those enabled by the keyboard and keyboard mapping provided by default with the computer. The most well-known techniques include

  • Alternate graphic (Script error: No such module "key". or right-Script error: No such module "key". key) that gives a third and fourth meaning to every key;
  • Compose key (sometimes called multi key), a key on a computer keyboard that indicates that the following (usually 2 or more) keystrokes trigger the insertion of an alternate character;[4]
  • A dead key, a normal key that is repurposed to affect the behaviour of the next key pressed. It is typically used to attach a specific diacritic to a base letter;[5]

or indeed combinations of these. The precise methods depend on which type of type of physical keyboard and (especially) the mapping used with it.

Selection from a screen

File:20170802073953!GNOME Character Map 3.18.2.png
GNOME Character Map

Many systems provide a way to select Unicode characters visually. ISO/IEC 14755 refers to this as a screen-selection entry method.[6]

Microsoft Windows has provided a Unicode version of the Character Map program, appearing in the consumer edition since XP. This is limited to characters in the Basic Multilingual Plane (BMP). Characters are searchable by Unicode character name, and the table can be limited to a particular code block.[7] Starting with Windows 10 Microsoft Windows also contains so called "emoji keyboard". It can be started by holding down the Windows key and hitting the period or semicolon key. The emoji keyboard allows entering of emojis as well as symbols.[8]

More advanced third-party tools of the same type are also available (a notable freeware example is BabelMap, which supports all Unicode characters). On most Linux desktop environments, equivalent tools – such as gucharmap (GNOME) or kcharselect (KDE) – are available.[9]

Generally these tools let the user "copy" the selected characters into the clipboard, and then paste them into the document, rather than pretending to directly type them.

It is often practical to just find the desired character on the web or in another document, and copy and paste it from there.

Decimal input (Alt codes)

Page Module:Message box/ambox.css has no content.

Some programs running in Microsoft Windows, including recent versions of Word and Notepad, can produce characters from their Unicode code points expressed in decimal and entered on the numeric keypad with the Script error: No such module "key". key held down.[10] For example, the Euro sign Template:Char has 20AC as its hexadecimal code point,[11] which is 8364 in decimal, so Script error: No such module "key".Script error: No such module "key". will produce the symbol.

Decimal code points in the range 160 –255 must be entered with a leading zero (so that the Windows code page is chosen) and furthermore the Windows code page CP1252 must be used.[b] For example, Script error: No such module "key".Script error: No such module "key". yields a Template:Char, corresponding to its code point, but the character produced by Script error: No such module "key".Script error: No such module "key". depends on the Template:Pslink, such as Code page 437, and may yield a Template:Char. Also Script error: No such module "key".Script error: No such module "key". through Script error: No such module "key".Script error: No such module "key". yield the characters assigned in rows 8 and 9 in the CP1252 layout, rather than the C1 control codes that are assigned to those numbers in Unicode.

In programs which were not designed to handle Alt codes over 255, the character retrieved usually corresponds to the remainder when the number is divided by 256.

The text editor Vim allows characters to be specified by two-character mnemonics referred to as digraphs.[12] The installed set can be augmented by custom mnemonics defined for arbitrary code points, specified in decimal. For example, as decimal 9881 is equal to hexadecimal 2699, dig Gr 9881 associates "Gr" with Page Template:Mono/styles.css has no content.U+2699 Script error: No such module "Unicode data"..

See below for use of decimal code points in HTML.

Hexadecimal input

Clause 5.1 of ISO/IEC 14755 describes a Basic method whereby a beginning sequence is followed by the hex number representation of the code point and the ending sequence. Most modern systems have some method to emulate this, sometimes limited to four digits (thus only the Basic Multilingual Plane).

In Microsoft Windows

Script error: No such module "Labelled list hatnote". Hexadecimal Unicode input can be enabled by adding a string type (REG_SZ) value called EnableHexNumpad to the registry key HKEY_CURRENT_USER\Control Panel\Input Method and assigning the value data 1 to it. Users will need to log off and back in after editing the registry for this input method to start working. (In versions earlier than Windows Vista, users needed to reboot for it to start working.) Unicode characters can then be entered by holding down Script error: No such module "key"., and typing Script error: No such module "key". on the numeric keypad, followed by the hexadecimal code, and then releasing Script error: No such module "key"..[2] This may not work for 5-digit hexadecimal codes like U+1F937. Some versions of Windows may require the digits 0-9 to be typed on the numeric keypad or require NumLock to be on.[citation needed]

In some applications (Office, Notepad and LibreOffice programs) Script error: No such module "key". will replace the hexadecimal number to the left of the cursor with the matching Unicode character. Unless it is six hexadecimal digits long, the code must not be preceded by any digit or letters a–f as they may be treated as part of the code to be converted. For example, entering af1 followed by Script error: No such module "key". (or Script error: No such module "key". if using a French version) will produce Page Template:Mono/styles.css has no content.U+0AF1 Script error: No such module "Unicode data"., but entering a0000f1 followed by Script error: No such module "key". will produce 'añ' (Template:Unichar2 followed by Page Template:Mono/styles.css has no content.U+00F1 ñ Script error: No such module "Unicode data".).[why?][citation needed]

This facility enables Unicode characters to be entered in other applications: one can create a desired character in Notepad, for example, and then cut and paste it wherever desired.

In MacOS

Hex input of Unicode must be enabled. In Mac OS 8.5 and later, one can choose the Unicode Hex Input keyboard layout; in OS X (10.10) Yosemite, this can be added in Keyboard → Input Sources.

Holding down Script error: No such module "key"., one types the four-digit hexadecimal Unicode code point and the equivalent character appears; one can then release the Script error: No such module "key". key.[13] Characters outside of the BMP (the Basic Multilingual Plane) exceed the four-digit limit of the Unicode hex input mechanism but can be entered by using surrogate pairs: holding down the Script error: No such module "key". key while entering the first surrogate, the Script error: No such module "key"., the second surrogate, then releasing the Option key.

In X11 and Wayland (Linux and other Unix variants including ChromeOS)

In many applications one or both of the following methods work to directly input Unicode characters:

  • Holding Script error: No such module "key". and typing Script error: No such module "key". followed by the hex digits, then releasing Script error: No such module "key"..
  • Entering Script error: No such module "key"., releasing, then typing the hex digits and pressing Script error: No such module "key". (or Script error: No such module "key". or even, on some systems, pressing and releasing Script error: No such module "key". or Script error: No such module "key".).[14]

This is supported by GTK and Qt applications, and possibly others. In ChromeOS, this is an operating system function.[14]

In platform-independent applications

  • In Emacs, Script error: No such module "key".Script error: No such module "key".Script error: No such module "key". invokes the insert-char command, which accepts input either via hex code point or unicode char name.
  • In LibreOffice 5.1 onwards, the Script error: No such module "key". method described above for Windows works.
  • In Opera versions that use the Presto layout engine—i.e. up to and including version 12.xx—, entering the hexadecimal number of the desired symbol or character and then pressing Script error: No such module "key". (alternative shortcut Script error: No such module "key". on macOS).
  • In the Vim editor, in insert mode, the user first types Script error: No such module "key". Script error: No such module "key". (for codepoints up to 4 hex digits long; using Script error: No such module "key". Script error: No such module "key". for longer), then types in the hexadecimal number of the symbol or character desired, and it will be converted into the symbol. (On Microsoft Windows, Script error: No such module "key". may be required instead of Script error: No such module "key"..[15])
  • In AutoCAD \U+2C72 or three shortcuts %%c, %%d, %%p.

HTML

Script error: No such module "Labelled list hatnote".

In HTML and XML, character codes to be rendered as characters are prefixed by ampersand and number sign (&#), and are followed by a semicolon (;). The code point can be either in decimal or in hexadecimal; in the latter case it is preceded by an "x". Leading zeros may be omitted. A number of characters may be represented by a named entity.

Example: In HTML/XML, Page Template:Mono/styles.css has no content.U+00A9 © Script error: No such module "Unicode data". may be coded as:

  • © (decimal code point)
  • © (hexadecimal code point)
  • © (entity name)

This works in many pieces of software that accept HTML markup, such as Thunderbird and Wikipedia editing.

See also

File:A-small glyphs.svg
Various glyphs representing the letter ⟨a⟩ in various typefaces and as single- and double-storey; they are allographs of the same grapheme

Notes

Page Template:Reflist/styles.css has no content.

  1. ^ or in fallback font(s), if any.
  2. ^ CP1252 is the default in North and South America including the Caribbean islands, Western Europe, Central and Southern Africa, Australia, New Zealand, and the (former) European colonies and possessions in Oceania

References

Page Template:Reflist/styles.css has no content.

  1. ^ Page Module:Citation/CS1/styles.css has no content.Lafontaine, Sylvain (February 17, 2012). "Unicode vs ASCII difference and benefits". MSDN. Archived from the original on 21 January 2022. Retrieved 28 February 2014.
  2. ^ a b Andrew Marcuse, "How to enter Unicode characters in Microsoft Windows". Access date: September 13, 2012
  3. ^ Page Module:Citation/CS1/styles.css has no content."Recommendations for OpenType Fonts". Microsoft. Glyph 0 must be assigned to a .notdef glyph. The .notdef glyph is very important for providing the user feedback that a glyph is not found in the font. This glyph should not be left without an outline as the user will only see what looks like a space if a glyph is missing and not be aware of the active font's limitation.
  4. ^ Page Module:Citation/CS1/styles.css has no content."Linux Keyboard Text Symbols: Compose-Key Shortcuts". FSymbols. 2013-07-24. Retrieved 2015-07-07.
  5. ^ Page Module:Citation/CS1/styles.css has no content."Dead Key | Definition of Dead Key by Merriam-Webster". Merriam-webster.com. Retrieved 2017-05-01.
  6. ^ Page Module:Citation/CS1/styles.css has no content."ISO/IEC 14755:1997 Information technology -- Input methods to enter characters from the repertoire of ISO/IEC 10646 with a keyboard or other input device". ISO. Retrieved 2017-10-14.
  7. ^ Page Module:Citation/CS1/styles.css has no content."How to Use Special Characters in Windows Documents". support.microsoft.com. Jul 31, 2019. Retrieved 2020-10-17.
  8. ^ Page Module:Citation/CS1/styles.css has no content."Windows 10 Tip: Get started with the emoji keyboard shortcut". blogs.windows.com. Feb 5, 2018. Retrieved 2024-06-04.
  9. ^ Page Module:Citation/CS1/styles.css has no content.Peck, Akkana (2009-11-25). "Mastering Characters Sets in Linux (Weird Characters, part 2)". LinuxPlanet. Archived from the original on 2010-11-26. Retrieved 2018-12-05.
  10. ^ Page Module:Citation/CS1/styles.css has no content."Insert ASCII or Unicode character codes in Word - Microsoft Support". support.microsoft.com. Retrieved 2025-02-08.
  11. ^ Page Module:Citation/CS1/styles.css has no content."Currency symbols". Unicode Consortium . Retrieved 2025-02-08.
  12. ^ Page Module:Citation/CS1/styles.css has no content."ii.com: Vim, Unicode, and Digraphs". www.ii.com. Retrieved 2025-02-08.
  13. ^ Typing special and accented characters Script error: No such module "webarchive".
  14. ^ a b Page Module:Citation/CS1/styles.css has no content.Jack Busch (April 20, 2018). "Type Special Characters with a Chromebook (Accents, Symbols, Em Dashes)". groovypost.com. Retrieved February 28, 2020.
  15. ^ Vim documentation: gui_w32

Lua error in package.lua at line 80: module 'Module:Navbox/configuration' not found.