A telegraph code is a character encoding used to transmit information through telegraphy machines. The most famous such code is Morse code.
Morse code can be transmitted and received with very simple electrical equipment, such as the electrical telegraph invented in 1816. Morse code represents each letter of the alphabet as a series of "dots and dashes" (short and long bursts of electronically-generated noise). The speed of sending is directly related to the length of the shortest (dot) element: a dash is three dots long, an inter-character gap is the same length (3 dots), and inter-word and sentence gaps should be 5 or 7 dots long (change from earlier standard – 5 dots). The speed of sending is also referred to as words per minute, and is classically based on the 'paris' formula - as 'paris' is considered to be an average length word. See main article on Morse Code.
Morse code can even be used to transmit Chinese characters. There already existed dictionaries which numbered the Chinese characters. It is simply a case of sending the numbers by Morse Code, and these numbers are then looked up in the dictionary at the receiving end.
In practice, this is a slow process, unless done by an expert Chinese telegrapher who can remember all the numbers of the approximately 5,000 characters in common use.
Manufacturers developed teleprinters to allow typed messages to be transmitted and received without Morse code training. At the time, hardware costs depended on the length of the longest code. With an alphabet of 26 uppercase letters, the code had to be at least 5 bits long. To reduce hardware cost, teleprinter manufacturers adopted the fixed-length 5 bit Baudot code (rather than trying to use variable-length Morse code).
Users were not satisfied with the limited character set available in Baudot code. Demand for lowercase letters and more punctuation marks led to teleprinters with a 6-bit TeleTypeSetter (TTS) code, and later, 7-bit ASCII code.