Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Bell character

From Wikipedia, the free encyclopedia
Device control code used to alert operators
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Bell character" – news ·newspapers ·books ·scholar ·JSTOR
(July 2011) (Learn how and when to remove this message)
Not to be confused withBell code.

Abell character (sometimesbell code) is a devicecontrol code originally sent to ring a small electromechanical bell ontickers and otherteleprinters and teletypewriters to alert operators at the other end of the line, often of an incoming message. Though tickers punched the bell codes into their tapes,[1] printers generally do not print a character when the bell code is received. Bell codes are usually represented by the label "BEL". They have been used since 1870 (initially in theBaudot code).[2]

To maintain backward compatibility, video displayterminals (VDTs) that replaced teletypewriters included speakers or buzzers to perform the same function, as did the personal computers that followed. Modernterminal emulators often integrate the warnings to the desktop environment (e.g., themacOSTerminal will play the system warning sound) and also often offer a silentvisual bell feature that flashes the terminal window briefly.

Representations

[edit]

InASCII the bell character's value is 7 and is named "BELL" or "BEL".Unicode does not give names to control characters but has assigned it the alias "ALERT" and abbreviation "BEL." It can sometimes be typed asctrl+G and displayed as^G incaret notation. Unicode also includes characters for the visual representation of the character:U+2407 SYMBOL FOR BELL andU+237E BELL SYMBOL.

In the 5-bit Baudot codes, BEL is represented by the number 11 (0x0B) when in "figures" mode.[3] The code0x2F is used inEBCDIC.

In the programming languageC (created in 1972), and in many languages influenced by it such asPython, the bell character can be placed in a string or character constant with\a. 'a' stands for "alert" or "audible" and was chosen because\b was already used for thebackspace character.[4]

Usage

[edit]
photograph of the keyboard for an Osborne 1 computer showing how the word "Bell" is also printed on the key for the letter "G"
Keyboard for theOsborne 1

OnUnix-like systems, or onMS-DOS orWindows, a user can cause the equivalent of ringing the bell to happen by typing at thecommand prompt the command:

echo ^G

where the^G is produced by holding downCtrl and typingG. On Unix the user may need to typeCtrl+V first to "quote" the^G.

On POSIX systems, one may also use:

printf '\a'

and in theBash shell, one may use ANSI-C quoting:[5]

echo $'\a'

An alternative is to use thetput command, which as a part of thencurses library is available on most Unix/Linux operating systems:

tput bel

A program can get the same result by printing the BEL character to a terminal.

On modern systems this may not make a noise; it may instead make a visual indication such as flashing the screen, or do nothing at all.

See also

[edit]

References

[edit]
  1. ^"Baudot". Archived fromthe original on December 19, 2008. RetrievedFebruary 1, 2009.
  2. ^Smith, Gil (2001)."Teletype Communication Codes"(PDF). Baudot.net.Archived(PDF) from the original on 20 August 2008. Retrieved2008-07-11.
  3. ^"The Lorenz Cipher and how Bletchley Park broke it".www.codesandciphers.org.uk. Retrieved9 July 2016.
  4. ^"2. Lexical analysis — Python 2.7.18 documentation".docs.python.org. Retrieved2021-02-05.
  5. ^ANSI-C quoting
Retrieved from "https://en.wikipedia.org/w/index.php?title=Bell_character&oldid=1177055949"
Category:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp