?? ascii.html
字號:
<HTML>
<HEAD>
<TITLE>ASCII Code</TITLE>
<meta name="description" content="Explains the ASCII code and some of its variants" >
<meta name="keywords" content="c++ console ASCII code" >
</HEAD>
<body bgcolor="white" >
<!--cap-->
<CENTER>
<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=1 BORDER=0>
<TR><TD WIDTH=90%>
<FONT SIZE=5><B> ASCII</B></FONT><BR>
<FONT SIZE=4>(American Standard Code for Information Interchange)</FONT>
</TD><TD VALIGN="bottom">
<a href="http://www.cplusplus.com" ><IMG SRC="/img/mini.gif" ALT="cplusplus.com" BORDER=0></A>
</TD></TR>
<TR><TD BGCOLOR="#0000FF" ALIGN="center" COLSPAN=2>
<IMG SRC="/img/2x2.gif" WIDTH=2 HEIGHT=2 BORDER=0></TD></TR>
</TABLE>
</CENTER>
<!--/cap-->
<P>
As you probably know, in its lower level computers can only handle <TT><B>0</B></TT>s
(zeros) and
<TT><B>1</B></TT>s (ones). Using sequences of <TT><B>0</B></TT> and <TT><B>1</B></TT>
a computer can handle numbers in binary format (as explained in document <A HREF="hex.html"><B>numeral radixes</B></A>).
Nevertheless there is no such evident way to represent letters with <TT><B>0</B></TT>s
and <TT><B>1</B></TT>s. For this purpose is the ASCII code used.
<P>
The ASCII code is a table or list containing all the letters of the alphabet plus
a variety of additional characters. In this code, each character is represented by
an order number, which is always the same.
For example, the ASCII code to represent the capital letter <TT><B>A</B></TT> is always
represented by order number <TT><B>65</B></TT>, which is easily representable using
<TT><B>0</B></TT>s and <TT><B>1</B></TT>s in binary notation (<TT><B>1000001</B></TT>).
<P>
The standard ASCII code defines 128 character codes (from 0 to 127).
The first 32 are control codes (non-printable), and the other 96 are representable
characters:
<BLOCKQUOTE>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=3>
<TR><TD ALIGN=center WIDTH=30>*</TD>
<TD BGCOLOR=silver ALIGN=center WIDTH=30><B>0</B></TD>
<TD BGCOLOR=silver ALIGN=center WIDTH=30><B>1</B></TD>
<TD BGCOLOR=silver ALIGN=center WIDTH=30><B>2</B></TD>
<TD BGCOLOR=silver ALIGN=center WIDTH=30><B>3</B></TD>
<TD BGCOLOR=silver ALIGN=center WIDTH=30><B>4</B></TD>
<TD BGCOLOR=silver ALIGN=center WIDTH=30><B>5</B></TD>
<TD BGCOLOR=silver ALIGN=center WIDTH=30><B>6</B></TD>
<TD BGCOLOR=silver ALIGN=center WIDTH=30><B>7</B></TD>
<TD BGCOLOR=silver ALIGN=center WIDTH=30><B>8</B></TD>
<TD BGCOLOR=silver ALIGN=center WIDTH=30><B>9</B></TD>
<TD BGCOLOR=silver ALIGN=center WIDTH=30><B>A</B></TD>
<TD BGCOLOR=silver ALIGN=center WIDTH=30><B>B</B></TD>
<TD BGCOLOR=silver ALIGN=center WIDTH=30><B>C</B></TD>
<TD BGCOLOR=silver ALIGN=center WIDTH=30><B>D</B></TD>
<TD BGCOLOR=silver ALIGN=center WIDTH=30><B>E</B></TD>
<TD BGCOLOR=silver ALIGN=center WIDTH=30><B>F</B></TD>
</TR>
<TR><TD BGCOLOR="silver" ALIGN=center WIDTH=30><B>0</B></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>NUL</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>SOH</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>STX</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>ETX</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>EOT</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>ENQ</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>ACK</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>BEL</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>BS</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>TAB</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>LF</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>VT</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>FF</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>CR</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>SO</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>SI</TT></FONT></TD>
</TR>
<TR><TD BGCOLOR="silver" ALIGN=center WIDTH=30><B>1</B></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>DLE</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>DC1</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>DC2</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>DC3</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>DC4</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>NAK</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>SYN</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>ETB</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>CAN</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>EM</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>SUB</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>ESC</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>FS</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>GS</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>RS</TT></FONT></TD>
<TD ALIGN=center WIDTH=30><FONT COLOR="green"><TT>US</TT></FONT></TD>
</TR>
<TR><TD BGCOLOR="silver" ALIGN=center WIDTH=30><B>2</B></TD>
<TD ALIGN=center WIDTH=30><TT> </TT></TD>
<TD ALIGN=center WIDTH=30><TT>!</TT></TD>
<TD ALIGN=center WIDTH=30><TT>"</TT></TD>
<TD ALIGN=center WIDTH=30><TT>#</TT></TD>
<TD ALIGN=center WIDTH=30><TT>$</TT></TD>
<TD ALIGN=center WIDTH=30><TT>%</TT></TD>
<TD ALIGN=center WIDTH=30><TT>&</TT></TD>
<TD ALIGN=center WIDTH=30><TT>'</TT></TD>
<TD ALIGN=center WIDTH=30><TT>(</TT></TD>
<TD ALIGN=center WIDTH=30><TT>)</TT></TD>
<TD ALIGN=center WIDTH=30><TT>*</TT></TD>
<TD ALIGN=center WIDTH=30><TT>+</TT></TD>
<TD ALIGN=center WIDTH=30><TT>,</TT></TD>
<TD ALIGN=center WIDTH=30><TT>-</TT></TD>
<TD ALIGN=center WIDTH=30><TT>.</TT></TD>
<TD ALIGN=center WIDTH=30><TT>/</TT></TD>
</TR>
<TR><TD BGCOLOR="silver" ALIGN=center WIDTH=30><B>3</B></TD>
<TD ALIGN=center WIDTH=30><TT>0</TT></TD>
<TD ALIGN=center WIDTH=30><TT>1</TT></TD>
<TD ALIGN=center WIDTH=30><TT>2</TT></TD>
<TD ALIGN=center WIDTH=30><TT>3</TT></TD>
<TD ALIGN=center WIDTH=30><TT>4</TT></TD>
<TD ALIGN=center WIDTH=30><TT>5</TT></TD>
<TD ALIGN=center WIDTH=30><TT>6</TT></TD>
<TD ALIGN=center WIDTH=30><TT>7</TT></TD>
<TD ALIGN=center WIDTH=30><TT>8</TT></TD>
<TD ALIGN=center WIDTH=30><TT>9</TT></TD>
<TD ALIGN=center WIDTH=30><TT>:</TT></TD>
<TD ALIGN=center WIDTH=30><TT>;</TT></TD>
<TD ALIGN=center WIDTH=30><TT><</TT></TD>
<TD ALIGN=center WIDTH=30><TT>=</TT></TD>
<TD ALIGN=center WIDTH=30><TT>></TT></TD>
<TD ALIGN=center WIDTH=30><TT>?</TT></TD>
</TR>
<TR><TD BGCOLOR="silver" ALIGN=center WIDTH=30><B>4</B></TD>
<TD ALIGN=center WIDTH=30><TT>@</TT></TD>
<TD ALIGN=center WIDTH=30><TT>A</TT></TD>
<TD ALIGN=center WIDTH=30><TT>B</TT></TD>
<TD ALIGN=center WIDTH=30><TT>C</TT></TD>
<TD ALIGN=center WIDTH=30><TT>D</TT></TD>
<TD ALIGN=center WIDTH=30><TT>E</TT></TD>
<TD ALIGN=center WIDTH=30><TT>F</TT></TD>
<TD ALIGN=center WIDTH=30><TT>G</TT></TD>
<TD ALIGN=center WIDTH=30><TT>H</TT></TD>
<TD ALIGN=center WIDTH=30><TT>I</TT></TD>
<TD ALIGN=center WIDTH=30><TT>J</TT></TD>
<TD ALIGN=center WIDTH=30><TT>K</TT></TD>
<TD ALIGN=center WIDTH=30><TT>L</TT></TD>
<TD ALIGN=center WIDTH=30><TT>M</TT></TD>
<TD ALIGN=center WIDTH=30><TT>N</TT></TD>
<TD ALIGN=center WIDTH=30><TT>O</TT></TD>
</TR>
<TR><TD BGCOLOR="silver" ALIGN=center WIDTH=30><B>5</B></TD>
<TD ALIGN=center WIDTH=30><TT>P</TT></TD>
<TD ALIGN=center WIDTH=30><TT>Q</TT></TD>
<TD ALIGN=center WIDTH=30><TT>R</TT></TD>
<TD ALIGN=center WIDTH=30><TT>S</TT></TD>
<TD ALIGN=center WIDTH=30><TT>T</TT></TD>
<TD ALIGN=center WIDTH=30><TT>U</TT></TD>
<TD ALIGN=center WIDTH=30><TT>V</TT></TD>
<TD ALIGN=center WIDTH=30><TT>W</TT></TD>
<TD ALIGN=center WIDTH=30><TT>X</TT></TD>
<TD ALIGN=center WIDTH=30><TT>Y</TT></TD>
<TD ALIGN=center WIDTH=30><TT>Z</TT></TD>
<TD ALIGN=center WIDTH=30><TT>[</TT></TD>
<TD ALIGN=center WIDTH=30><TT>\</TT></TD>
<TD ALIGN=center WIDTH=30><TT>]</TT></TD>
<TD ALIGN=center WIDTH=30><TT>^</TT></TD>
<TD ALIGN=center WIDTH=30><TT>_</TT></TD>
</TR>
<TR><TD BGCOLOR="silver" ALIGN=center WIDTH=30><B>6</B></TD>
<TD ALIGN=center WIDTH=30><TT>`</TT></TD>
<TD ALIGN=center WIDTH=30><TT>a</TT></TD>
<TD ALIGN=center WIDTH=30><TT>b</TT></TD>
<TD ALIGN=center WIDTH=30><TT>c</TT></TD>
<TD ALIGN=center WIDTH=30><TT>d</TT></TD>
<TD ALIGN=center WIDTH=30><TT>e</TT></TD>
<TD ALIGN=center WIDTH=30><TT>f</TT></TD>
<TD ALIGN=center WIDTH=30><TT>g</TT></TD>
<TD ALIGN=center WIDTH=30><TT>h</TT></TD>
<TD ALIGN=center WIDTH=30><TT>i</TT></TD>
<TD ALIGN=center WIDTH=30><TT>j</TT></TD>
<TD ALIGN=center WIDTH=30><TT>k</TT></TD>
<TD ALIGN=center WIDTH=30><TT>l</TT></TD>
<TD ALIGN=center WIDTH=30><TT>m</TT></TD>
<TD ALIGN=center WIDTH=30><TT>n</TT></TD>
<TD ALIGN=center WIDTH=30><TT>o</TT></TD>
</TR>
<TR><TD BGCOLOR="silver" ALIGN=center WIDTH=30><B>7</B></TD>
<TD ALIGN=center WIDTH=30><TT>p</TT></TD>
<TD ALIGN=center WIDTH=30><TT>q</TT></TD>
<TD ALIGN=center WIDTH=30><TT>r</TT></TD>
<TD ALIGN=center WIDTH=30><TT>s</TT></TD>
<TD ALIGN=center WIDTH=30><TT>t</TT></TD>
<TD ALIGN=center WIDTH=30><TT>u</TT></TD>
<TD ALIGN=center WIDTH=30><TT>v</TT></TD>
<TD ALIGN=center WIDTH=30><TT>w</TT></TD>
<TD ALIGN=center WIDTH=30><TT>x</TT></TD>
<TD ALIGN=center WIDTH=30><TT>y</TT></TD>
<TD ALIGN=center WIDTH=30><TT>z</TT></TD>
<TD ALIGN=center WIDTH=30><TT>{</TT></TD>
<TD ALIGN=center WIDTH=30><TT>|</TT></TD>
<TD ALIGN=center WIDTH=30><TT>}</TT></TD>
<TD ALIGN=center WIDTH=30><TT>~</TT></TD>
<TD ALIGN=center WIDTH=30><TT> </TT></TD>
</TR>
</TABLE>
* This panel is organized to be easily read in hexadecimal: row numbers represent the
first digit and the column numbers represent the second one. For example, the
<TT><B>A</B></TT> character is located at the <TT><B>4th</B></TT> row and the
<TT><B>1st</B></TT> column, so it would be represented as hexadecimal
number <TT><B>0x41</B></TT> (<TT><b>65</B></TT>).
</BLOCKQUOTE>
<P>
In addition to the 128 standard ASCII codes (the ones listed above ranging from 0 to 127),
most machines have another 128 extra codes which form what is known as extended ASCII
(with ranges from 129 to 255).
This extended ASCII character set is platform-dependent, meaning that it may vary from one
machine to another, or between operating systems.
<P>
The most-used extended ASCII character sets are OEM and ANSI.
<P>
The OEM character set is included in all PC-compatible computers as the default character
set when the system boots before loading any operating system and under MS-DOS.
It includes some foreign signs, some marked characters and also pieces to draw simple panels.
Unfortunately it is usually redefined by some regional country-specific configurations
to include local symbols.
<BLOCKQUOTE><IMG SRC="ascii1.gif"></BLOCKQUOTE>
The ANSI character set is a standard that is included in systems like Windows, some
UNIX platforms and some applications. It includes many more local symbols and marked
letters than OEM so it can be used with more languages without having to be redefined:
<BLOCKQUOTE><IMG SRC="ascii2.gif"></BLOCKQUOTE>
<P>
Here you have an interactive Decimal-Hexadecimal-Octal-ASCII converter (Netscape 3+ or MSIE 4+):
<P><CENTER>
<!--***************************************************************************-->
<!--* DEC-HEX-OCT-ASCII converter by Juan Soulie - http://www.soulie.com/juan *-->
<!--***************************************************************************-->
<script language="JavaScript" >
<!--
function updt (f,n) {
var asc=" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -