Deep graphic character set and character set encoding (eight)--ascii and iso-8859-1

Source: Internet
Author: User
Tags control characters printable characters

In front of actually also talked about the ASCII, but not very specific, as a part of a complete series, or it is necessary to talk about, but also as a basis for discussion later.


Its full name is american Standard Code for information Interchange (US Information Interchange Standard code), is a 7-bit character encoding scheme. Here is a schematic of it (from Http://

ASCII defines 128 characters, including 33 non-printable control characters (non-printing controls characters) and 95 printable characters.

Control characters

32 and the last 127 are the so-called control characters. (0X00~0X1F and 0x7f)

That is, 32 characters in the leftmost column and the last character of the rightmost column (DEL, delete)

Familiar with 0x09 (tab,horizontal tab, Horizontal tab), 0x0A (lf,line feed, ' \ n ' line break), 0x0D (cr,carriage return, ' \ R ' carriage return), many others are now obsolete.

About carriage return (' \ r \ n '), in an era when the screen is not yet popular, the result output is often dependent on the so-called fax printer, where the print head moves from left to right along the print bar and prints out the characters, when a carriage return is encountered (cr,0x0d, ' \ R '), the printer directs the printhead back to the leftmost position, which is the traditional return. (You can think of the printhead as a car, the return is the return, the modern sense of the carriage return is usually included in the carriage return and line two action)

A carriage return usually follows a newline character (lf,0x0a, ' \ n '), and the printer receives a newline character that instructs the drum to scroll so that the printhead is aligned with a new line on the paper. If there is no line break, the new printout will overlap on the previous line, which can sometimes occur when the paper is not running smoothly.

Currently, on a Windows system, the ENTER key produces two characters CRLF, which together represent a newline. Unix/linux and the like are separated by the LF, while Apple's Mac uses the CR to represent the line break alone.

Other characters

Include spaces, letters, numbers, and some common punctuation.

With respect to spaces (space, the first of the second column in the diagram, 0x20), it is not classified as a control character class, and of course, you may struggle to see if it is printable.

Because only 27 = 128 characters are defined, fully encoded with 7bit, and a byte 8bit capacity is 256, so one byte of ASCII encoding is always the highest bit 0, which is compatible with the subsequent encoding scheme it brings convenience.


Iso-8859-1, also known as Latin-1, is a 8-bit single-byte character set, which uses the highest ASCII bit and is compatible with ASCII, and the new theoretical space is 128, but it is not completely exhausted: (from WIKI/ISO/IEC_8859-1)

As you can see, the new section also retains the previous 32 positions (the middle Green Section, 0x80-0x9f), similar to the previous ASCII section, so the actual increase is only 128-32 = 96, mostly Western European characters, It is also possible to see that multiplication sign (0xD7) and division sign (0XF7) are included.

0x00-0x1f, 0x7F, 0x80-0x9f are not defined in this character set. (That is, the green part of the figure)

Iso-8859-1 can be compatible with ASCII, and its scope of application is broader, some protocols or software as a default encoding, of course, now the better choice is UTF-8.

Deep graphic character set and character set encoding (eight)--ascii and iso-8859-1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.