ASCII and Unicode

《编程导论(Java)·1.2.3 五种Java元素》中提到:

Java支持Unicode字符集(Unicode character set)。它以16位来表示一个字符,其中最前的128个字符则是ASCII( The American StandardCode form Information Interchange)码字符。

Java中的标识符、注释、字符文字、字符串文字可以使用Unicode,而关键字、操作符等其他Java元素则使用ASCII中的(一些)字符。

代码库codes中的相关代码

package tips;
import static tips.Print.*;

/**
 *ASCII字符
 * @author yqj2065
 * @version 2011.10
 */
public class Ascii{
     //打印Ascii,其中不可打印字符,自然看不见。
     public static void plintAscii(){
        for(byte i =0;i< 128 && i>=0;i++){
            System.out.println(i+" "+ (char)i);
        }
    }
    /**
     * Unicode字符集(Unicode character set),以16位来表示一个字符,
     * 其中最前的128个字符则是ASCII.
     * 测试参数:48、65、97、130、258、20005
     * 将形参改为byte,测试[0,127]数据!
     */
    public static void testUnicode(int i){
        //int[] data = {};
        pln(i+" "+ (char)i);
    }    
}


ASCII and Latin-1 字符表

ASCII and Latin-1 Character Table
CharDecHexOctalHTMLNotes
^@00x000000^@NUL nul
^A10x010001^ASOH start of header
^B20x020002^BSTX start of text
^C30x030003^CETX end of text
^D40x040004^DEOT end of transmission
^E50x050005^EENQ enquiry
^F60x060006^FACK acknowledege
^G70x070007^GBEL bell
^H80x080010^HBS backspace [/b]
^I90x090011^IHT horizonal tab [/t]
^J100x0a0012^JLF line feed [/n]
^K110x0b0013^KVT vertical tab
^L120x0c0014^LFF form feed [/f]
^M130x0d0015^MCR carriage return [/r]
^N140x0e0016^NSO shift out
^O150x0f0017^OSI shift in
^P160x100020^PDLE data link escape
^Q170x110021^QDC1 device control 1, XON resume transmission
^R180x120022^RDC2 device control 2
^S190x130023^SDC3 device control 3, XOFF pause transmission
^T200x140024^TDC4 device control 4
^U210x150025^UNAK negative acknowledge
^V220x160026^VSYN synchronise
^W230x170027^WETB end text block
^X240x180030^XCAN cancel
^Y250x190031^YEM end message
^Z260x1a0032^ZSUB substitute
^[270x1b0033^[ESC escape
^/280x1c0034^/FS file separator, usually used to separate groups of records.
^]290x1d0035^]GS group separator, usually used to separate fields.
^^300x1e0036^^RS record separator, usually used to separate records.
^_310x1f0037^_US unit separator, usually used to separate subfields.
 320x200040&nbsp;space
!330x210041!bang, exclamation
"340x220042&quot;quote
#350x230043#sharp, number sign
$360x240044$dollar sign
%370x250045%percent
&380x260046&amp;ampersand
'390x270047'apostrophe
(400x280050(left parenthesis
)410x290051)right parenthesis
*420x2a0052*star, asterisk
+430x2b0053+plus
,440x2c0054,comma
-450x2d0055-minus
.460x2e0056.period
/470x2f0057/slash, not backslash!
0480x3000600digit 0
1490x3100611digit 1
2500x3200622digit 2
3510x3300633digit 3
4520x3400644digit 4
5530x3500655digit 5
6540x3600666digit 6
7550x3700677digit 7
8560x3800708digit 8
9570x3900719digit 9
:580x3a0072:colon
;590x3b0073;semicolon
<600x3c0074&lt;less than
=610x3d0075=equals
>620x3e0076&gt;greater than
?630x3f0077?question mark
@640x400100@at sign
A650x410101Aupper case A
B660x420102Bupper case B
C670x430103Cupper case C
D680x440104Dupper case D
E690x450105Eupper case E
F700x460106Fupper case F
G710x470107Gupper case G
H720x480110Hupper case H
I730x490111Iupper case I
J740x4a0112Jupper case J
K750x4b0113Kupper case K
L760x4c0114Lupper case L
M770x4d0115Mupper case M
N780x4e0116Nupper case N
O790x4f0117Oupper case O
P800x500120Pupper case P
Q810x510121Qupper case Q
R820x520122Rupper case R
S830x530123Supper case S
T840x540124Tupper case T
U850x550125Uupper case U
V860x560126Vupper case V
W870x570127Wupper case W
X880x580130Xupper case X
Y890x590131Yupper case Y
Z900x5a0132Zupper case Z
[910x5b0133[left square bracket
/920x5c0134/backslash, not slash!
]930x5d0135]right square bracket
^940x5e0136^hat, circumflex
_950x5f0137_underscore
`960x600140`grave, rhymes with have
a970x610141alower case a
b980x620142blower case b
c990x630143clower case c
d1000x640144dlower case d
e1010x650145elower case e
f1020x660146flower case f
g1030x670147glower case g
h1040x680150hlower case h
i1050x690151ilower case i
j1060x6a0152jlower case j
k1070x6b0153klower case k
l1080x6c0154llower case l
m1090x6d0155mlower case m
n1100x6e0156nlower case n
o1110x6f0157olower case o
p1120x700160plower case p
q1130x710161qlower case q
r1140x720162rlower case r
s1150x730163slower case s
t1160x740164tlower case t
u1170x750165ulower case u
v1180x760166vlower case v
w1190x770167wlower case w
x1200x780170xlower case x
y1210x790171ylower case y
z1220x7a0172zlower case z
{1230x7b0173{left curly brace
|1240x7c0174|vertical bar
}1250x7d0175}right curly brace
~1260x7e0176~tilde
1270x7f0177&#127;DEL delete
1280x800200&#128; 
1290x810201&#129; 
1300x820202&#130; 
ƒ1310x830203&#131; 
1320x840204&#132; 
1330x850205&#133; 
1340x860206&#134; 
1350x870207&#135; 
ˆ1360x880210&#136; 
1370x890211&#137; 
Š1380x8a0212&#138; 
1390x8b0213&#139; 
Œ1400x8c0214&#140; 
1410x8d0215&#141; 
Ž1420x8e0216&#142; 
1430x8f0217&#143; 
1440x900220&#144; 
1450x910221&#145; 
1460x920222&#146; 
1470x930223&#147; 
1480x940224&#148; 
1490x950225&#149; 
1500x960226&#150; 
1510x970227&#151; 
˜1520x980230&#152; 
1530x990231&#153; 
š1540x9a0232&#154; 
1550x9b0233&#155; 
œ1560x9c0234&#156; 
1570x9d0235&#157; 
ž1580x9e0236&#158; 
Ÿ1590x9f0237&#159; 
 1600xa00240&#160; 
¡1610xa10241&#161;PostScript (¡) exclamdown
¢1620xa20242&#162;PostScript (¢) cent
£1630xa30243&#163;PostScript (£) sterling
¤1640xa40244&#164;PostScript (/) fraction
¥1650xa50245&#165;PostScript (¥) yen
¦1660xa60246&#166;PostScript (ƒ) florin
§1670xa70247&#167;PostScript (§) section
¨1680xa80250&#168;PostScript (¤) currency
©1690xa90251&#169;PostScript (') quotesingle
ª1700xaa0252&#170;PostScript (“) quotedblleft
«1710xab0253&#171;PostScript («) guillemotleft
¬1720xac0254&#172;PostScript (<) guilsinglleft
­1730xad0255&#173;PostScript (>) guilsinglright
®1740xae0256&#174;PostScript fi ligature
¯1750xaf0257&#175;PostScript fl ligature;
°1760xb00260&#176; 
±1770xb10261&#177;PostScript (–) endash
²1780xb20262&#178;PostScript (†) dagger
³1790xb30263&#179;PostScript (·) periodcentered
´1800xb40264&#180; 
µ1810xb50265&#181; 
1820xb60266&#182;PostScript (¶) paragraph
·1830xb70267&#183;PostScript (•) bullet
¸1840xb80270&#184;PostScript (,) quotesinglbase
¹1850xb90271&#185;PostScript („) quotedblbase
º1860xba0272&#186;PostScript (”) quotedblright
»1870xbb0273&#187;PostScript (») guillemotright
¼1880xbc0274&#188;PostScript (…) ellipsis
½1890xbd0275&#189;PostScript (‰) perthousand
¾1900xbe0276&#190; 
¿1910xbf0277&#191;PostScript (¿) questiondown
À1920xc00300&#192; 
Á1930xc10301&#193;PostScript (`) grave
Â1940xc20302&#194;PostScript (´) acute
Ã1950xc30303&#195;PostScript (^) circumflex
Ä1960xc40304&#196;PostScript (~) tilde
Å1970xc50305&#197;PostScript (¯) macron, overbar accent
Æ1980xc60306&#198;PostScript (u) breve, flattened u-shaped accent
Ç1990xc70307&#199;PostScript (·) dotaccent
È2000xc80310&#200;PostScript (¨) dieresis
É2010xc90311&#201; 
Ê2020xca0312&#202;PostScript (°) ring
Ë2030xcb0313&#203;PostScript (¸) cedilla
Ì2040xcc0314&#204; 
Í2050xcd0315&#205;PostScript (”) hungarumlaut
Î2060xce0316&#206;PostScript (,) ogonek, reverse comma
Ï2070xcf0317&#207;PostScript (v) caron, flattened v-shaped accent
Ð2080xd00320&#208;PostScript (—) emdash
Ñ2090xd10321&#209; 
Ò2100xd20322&#210; 
Ó2110xd30323&#211; 
Ô2120xd40324&#212; 
Õ2130xd50325&#213; 
Ö2140xd60326&#214; 
×2150xd70327&#215; 
Ø2160xd80330&#216; 
Ù2170xd90331&#217; 
Ú2180xda0332&#218; 
Û2190xdb0333&#219; 
Ü2200xdc0334&#220; 
Ý2210xdd0335&#221; 
Þ2220xde0336&#222; 
ß2230xdf0337&#223; 
à2240xe00340&#224; 
á2250xe10341&#225;PostScript (Æ) AE
â2260xe20342&#226; 
ã2270xe30343&#227;PostScript (ª) ordfeminine
ä2280xe40344&#228; 
å2290xe50345&#229; 
æ2300xe60346&#230; 
ç2310xe70347&#231; 
è2320xe80350&#232;PostScript (L/) Lslash, L with / overstrike
é2330xe90351&#233;PostScript (Ø) Oslash
ê2340xea0352&#234;PostScript (Œ) OE
ë2350xeb0353&#235;PostScript (º) ordmasculine
ì2360xec0354&#236; 
í2370xed0355&#237; 
î2380xee0356&#238; 
ï2390xef0357&#239; 
ð2400xf00360&#240; 
ñ2410xf10361&#241;PostScript (æ) ae
ò2420xf20362&#242; 
ó2430xf30363&#243; 
ô2440xf40364&#244; 
õ2450xf50365&#245;PostScript (1) dotlessi, i without dot
ö2460xf60366&#246; 
÷2470xf70367&#247; 
ø2480xf80370&#248;PostScript (l/) l with / overstrike
ù2490xf90371&#249;PostScript (ø) oslash
ú2500xfa0372&#250;PostScript (œ) oe
û2510xfb0373&#251;PostScript (ß) germandbls
ü2520xfc0374&#252; 
ý2530xfd0375&#253; 
þ2540xfe0376&#254; 
ÿ2550xff0377&#255; 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值