楼主: ebizs

借人气问个JavaScript的问题

[复制链接]
论坛徽章:
6
会员2006贡献徽章
日期:2006-04-17 13:46:34生肖徽章:龙
日期:2007-07-15 20:26:43会员2007贡献徽章
日期:2007-09-26 18:42:10生肖徽章2007版:猴
日期:2008-02-23 15:25:27生肖徽章2007版:狗
日期:2008-02-26 20:05:57奥运会纪念徽章:皮划艇激流回旋
日期:2008-08-06 22:20:41
11#
发表于 2007-8-24 20:31 | 只看该作者
举例说,
escape("中文Abc"   ==>  %u4E2D%u6857Abc

是不是很好判断了

使用道具 举报

回复
论坛徽章:
138
12#
 楼主| 发表于 2007-8-24 20:34 | 只看该作者
最初由 Yes!Surfer 发布
[B]中文是双字节的,你如果用escape函数做变换的话,根据变换结果很容易判断。 [/B]


日语,韩语,阿拉伯语呢?这些我都不知道啊

使用道具 举报

回复
论坛徽章:
6
会员2006贡献徽章
日期:2006-04-17 13:46:34生肖徽章:龙
日期:2007-07-15 20:26:43会员2007贡献徽章
日期:2007-09-26 18:42:10生肖徽章2007版:猴
日期:2008-02-23 15:25:27生肖徽章2007版:狗
日期:2008-02-26 20:05:57奥运会纪念徽章:皮划艇激流回旋
日期:2008-08-06 22:20:41
13#
发表于 2007-8-24 21:08 | 只看该作者
最初由 ebizs 发布
[B]

日语,韩语,阿拉伯语呢?这些我都不知道啊 [/B]


你用escape函数可以取得字符的unicode编码(大致就是%uxxxx, 四个x表示4个16进制位),然后根据unicode编码分配表就可以判断是哪个字符集的(就是看前两个16进制位),分配表简单如下:

_______ ___________________________________________________________________

Row(s)  Content (script, other groups of characters, reserved area)
_______ ___________________________________________________________________

======= A-ZONE (alphabetical characters and symbols) =======================
00      (Control characters,) Basic Latin, Latin-1 Supplement (=ISO/IEC 8859-1)
01      Latin Extended-A, Latin Extended-B
02      Latin Extended-B, IPA Extensions, Spacing Modifier Letters
03      Combining Diacritical Marks, Basic Greek, Greek Symbols and Coptic
04      Cyrillic
05      Armenian, Hebrew
06      Basic Arabic, Arabic Extended
07--08  (Reserved for future standardization)
09      Devanagari, Bengali
0A      Gumukhi, Gujarati
0B      Oriya, Tamil
0C      Telugu, Kannada
0D      Malayalam
0E      Thai, Lao
0F      (Reserved for future standardization)
10      Georgian
11      Hangul Jamo
12--1D  (Reserved for future standardization)
1E      Latin Extended Additional
1F      Greek Extended
20      General Punctuation, Super/subscripts, Currency, Combining Symbols
21      Letterlike Symbols, Number Forms, Arrows
22      Mathematical Operators
23      Miscellaneous Technical Symbols
24      Control Pictures, OCR, Enclosed Alphanumerics
25      Box Drawing, Block Elements, Geometric Shapes
26      Miscellaneous Symbols
27      Dingbats
28--2F  (Reserved for future standardization)
30      CJK Symbols and Punctuation, Hiragana, Katakana
31      Bopomofo, Hangul Compatibility Jamo, CJK Miscellaneous
32      Enclosed CJK Letters and Months
33      CJK Compatibility
34--4D  Hangul

======= I-ZONE (ideographic characters) ===================================
4E--9F  CJK Unified Ideographs

======= O-ZONE (open zone) ================================================
A0--DF  (Reserved for future standardization)

======= R-ZONE (restricted use zone) ======================================
E0--F8  (Private Use Area)
F9--FA  CJK Compatibility Ideographs
FB      Alphabetic Presentation Forms, Arabic Presentation Forms-A
FC--FD  Arabic Presentation Forms-A
FE      Combining Half Marks, CJK Compatibility Forms, Small Forms, Arabic-B
FF      Halfwidth and Fullwidth Forms, Specials

使用道具 举报

回复
论坛徽章:
6
会员2006贡献徽章
日期:2006-04-17 13:46:34生肖徽章:龙
日期:2007-07-15 20:26:43会员2007贡献徽章
日期:2007-09-26 18:42:10生肖徽章2007版:猴
日期:2008-02-23 15:25:27生肖徽章2007版:狗
日期:2008-02-26 20:05:57奥运会纪念徽章:皮划艇激流回旋
日期:2008-08-06 22:20:41
14#
发表于 2007-8-24 21:09 | 只看该作者
CJK 是中文(Chinese)、日文(Japanese)、韩文(Korean)三国文字的缩写。

使用道具 举报

回复
论坛徽章:
6
会员2006贡献徽章
日期:2006-04-17 13:46:34生肖徽章:龙
日期:2007-07-15 20:26:43会员2007贡献徽章
日期:2007-09-26 18:42:10生肖徽章2007版:猴
日期:2008-02-23 15:25:27生肖徽章2007版:狗
日期:2008-02-26 20:05:57奥运会纪念徽章:皮划艇激流回旋
日期:2008-08-06 22:20:41
15#
发表于 2007-8-24 21:12 | 只看该作者

完整的CJK Unicode范围(5.0版)

  因为FontRouter新版本开发的需要,在网上搜索了一下汉字的Unicode范围,普遍给出了“U+4E00..U+9FA5”。但事实上这个范围是不完整的,甚至连基本的全角(中文)标点也未包含在内。为此,我特地查询了Unicode官方的Code Charts数据库,并根据最新的Unicode 5.0版整理如下:

注:在绝大多数应用场合中,我们可以仅用(1)、(2)、(3)、(4)、(5)的集合作为CJK判断的依据。

1)标准CJK文字
http://www.unicode.org/Public/UNIDATA/Unihan.html

Code point range Block name Release
U+3400..U+4DB5 CJK Unified Ideographs Extension A 3.0
U+4E00..U+9FA5 CJK Unified Ideographs 1.1
U+9FA6..U+9FBB CJK Unified Ideographs 4.1
U+F900..U+FA2D CJK Compatibility Ideographs 1.1
U+FA30..U+FA6A CJK Compatibility Ideographs 3.2
U+FA70..U+FAD9 CJK Compatibility Ideographs 4.1
U+20000..U+2A6D6 CJK Unified Ideographs Extension B 3.1
U+2F800..U+2FA1D CJK Compatibility Supplement 3.1

2)全角ASCII、全角中英文标点、半宽片假名、半宽平假名、半宽韩文字母:FF00-FFEF
http://www.unicode.org/charts/PDF/UFF00.pdf

3)CJK部首补充:2E80-2EFF
http://www.unicode.org/charts/PDF/U2E80.pdf

4)CJK标点符号:3000-303F
http://www.unicode.org/charts/PDF/U3000.pdf

5)CJK笔划:31C0-31EF
http://www.unicode.org/charts/PDF/U31C0.pdf

6)康熙部首:2F00-2FDF
http://www.unicode.org/charts/PDF/U2F00.pdf

7)汉字结构描述字符:2FF0-2FFF
http://www.unicode.org/charts/PDF/U2FF0.pdf

8)注音符号:3100-312F
http://www.unicode.org/charts/PDF/U3100.pdf

9)注音符号(闽南语、客家语扩展):31A0-31BF
http://www.unicode.org/charts/PDF/U31A0.pdf

10)日文平假名:3040-309F
http://www.unicode.org/charts/PDF/U3040.pdf

11)日文片假名:30A0-30FF
http://www.unicode.org/charts/PDF/U30A0.pdf

12)日文片假名拼音扩展:31F0-31FF
http://www.unicode.org/charts/PDF/U31F0.pdf

13)韩文拼音:AC00-D7AF
http://www.unicode.org/charts/PDF/UAC00.pdf

14)韩文字母:1100-11FF
http://www.unicode.org/charts/PDF/U1100.pdf

15)韩文兼容字母:3130-318F
http://www.unicode.org/charts/PDF/U3130.pdf

16)太玄经符号:1D300-1D35F
http://www.unicode.org/charts/PDF/U1D300.pdf

17)易经六十四卦象:4DC0-4DFF
http://www.unicode.org/charts/PDF/U4DC0.pdf

18)彝文音节:A000-A48F
http://www.unicode.org/charts/PDF/UA000.pdf

19)彝文部首:A490-A4CF
http://www.unicode.org/charts/PDF/UA490.pdf

20)盲文符号:2800-28FF
http://www.unicode.org/charts/PDF/U2800.pdf

21)CJK字母及月份:3200-32FF
http://www.unicode.org/charts/PDF/U3200.pdf

22)CJK特殊符号(日期合并):3300-33FF
http://www.unicode.org/charts/PDF/U3300.pdf

23)装饰符号(非CJK专用):2700-27BF
http://www.unicode.org/charts/PDF/U2700.pdf

24)杂项符号(非CJK专用):2600-26FF
http://www.unicode.org/charts/PDF/U2600.pdf

25)中文竖排标点:FE10-FE1F
http://www.unicode.org/charts/PDF/UFE10.pdf

26)CJK兼容符号(竖排变体、下划线、顿号):FE30-FE4F
http://www.unicode.org/charts/PDF/UFE30.pdf

以上翻译自Unicode官方网站,部分译法可能不够准确,还望大家予以指正!如有疏漏、错误之处也请一并指出,多谢!

转自:http://blog.oasisfeng.com/2006/10/19/full-cjk-unicode-range/

使用道具 举报

回复
论坛徽章:
96
秀才
日期:2017-02-22 15:18:00玉兔
日期:2015-10-05 09:02:46双子座
日期:2015-08-10 18:45:20ITPUB年度最佳版主
日期:2015-03-18 15:48:48法拉利
日期:2013-12-25 19:32:35法拉利
日期:2013-12-25 17:16:47法拉利
日期:2013-12-23 21:04:09法拉利
日期:2013-12-19 14:19:27法拉利
日期:2013-12-19 07:10:24ITPUB14周年纪念章
日期:2015-10-26 17:23:44
16#
发表于 2007-8-24 21:14 | 只看该作者
这个好啊

使用道具 举报

回复
论坛徽章:
138
17#
 楼主| 发表于 2007-8-24 21:16 | 只看该作者

Re: 完整的CJK Unicode范围(5.0版)

最初由 Yes!Surfer 发布
[B]  因为FontRouter新版本开发的需要,在网上搜索了一下汉字的Unicode范围,普遍给出了“U+4E00..U+9FA5”。但事实上这个范围是不完整的,甚至连基本的全角(中文)标点也未包含在内。为此,我特地查询了Unicode官方的Code Charts数据库,并根据最新的Unicode 5.0版整理如下:

注:在绝大多数应用场合中,我们可以仅用(1)、(2)、(3)、(4)、(5)的集合作为CJK判断的依据。

1)标准CJK文字
http://www.unicode.org/Public/UNIDATA/Unihan.html

Code point range Block name Release
U+3400..U+4DB5 CJK Unified Ideographs Extension A 3.0
U+4E00..U+9FA5 CJK Unified Ideographs 1.1
U+9FA6..U+9FBB CJK Unified Ideographs 4.1
U+F900..U+FA2D CJK Compatibility Ideographs 1.1
U+FA30..U+FA6A CJK Compatibility Ideographs 3.2
U+FA70..U+FAD9 CJK Compatibility Ideographs 4.1
U+20000..U+2A6D6 CJK Unified Ideographs Extension B 3.1
U+2F800..U+2FA1D CJK Compatibility Supplement 3.1

2)全角ASCII、全角中英文标点、半宽片假名、半宽平假名、半宽韩文字母:FF00-FFEF
http://www.unicode.org/charts/PDF/UFF00.pdf

3)CJK部首补充:2E80-2EFF
http://www.unicode.org/charts/PDF/U2E80.pdf

4)CJK标点符号:3000-303F
http://www.unicode.org/charts/PDF/U3000.pdf

5)CJK笔划:31C0-31EF
http://www.unicode.org/charts/PDF/U31C0.pdf

6)康熙部首:2F00-2FDF
http://www.unicode.org/charts/PDF/U2F00.pdf

7)汉字结构描述字符:2FF0-2FFF
http://www.unicode.org/charts/PDF/U2FF0.pdf

8)注音符号:3100-312F
http://www.unicode.org/charts/PDF/U3100.pdf

9)注音符号(闽南语、客家语扩展):31A0-31BF
http://www.unicode.org/charts/PDF/U31A0.pdf

10)日文平假名:3040-309F
http://www.unicode.org/charts/PDF/U3040.pdf

11)日文片假名:30A0-30FF
http://www.unicode.org/charts/PDF/U30A0.pdf

12)日文片假名拼音扩展:31F0-31FF
http://www.unicode.org/charts/PDF/U31F0.pdf

13)韩文拼音:AC00-D7AF
http://www.unicode.org/charts/PDF/UAC00.pdf

14)韩文字母:1100-11FF
http://www.unicode.org/charts/PDF/U1100.pdf

15)韩文兼容字母:3130-318F
http://www.unicode.org/charts/PDF/U3130.pdf

16)太玄经符号:1D300-1D35F
http://www.unicode.org/charts/PDF/U1D300.pdf

17)易经六十四卦象:4DC0-4DFF
http://www.unicode.org/charts/PDF/U4DC0.pdf

18)彝文音节:A000-A48F
http://www.unicode.org/charts/PDF/UA000.pdf

19)彝文部首:A490-A4CF
http://www.unicode.org/charts/PDF/UA490.pdf

20)盲文符号:2800-28FF
http://www.unicode.org/charts/PDF/U2800.pdf

21)CJK字母及月份:3200-32FF
http://www.unicode.org/charts/PDF/U3200.pdf

22)CJK特殊符号(日期合并):3300-33FF
http://www.unicode.org/charts/PDF/U3300.pdf

23)装饰符号(非CJK专用):2700-27BF
http://www.unicode.org/charts/PDF/U2700.pdf

24)杂项符号(非CJK专用):2600-26FF
http://www.unicode.org/charts/PDF/U2600.pdf

25)中文竖排标点:FE10-FE1F
http://www.unicode.org/charts/PDF/UFE10.pdf

26)CJK兼容符号(竖排变体、下划线、顿号):FE30-FE4F
http://www.unicode.org/charts/PDF/UFE30.pdf

以上翻译自Unicode官方网站,部分译法可能不够准确,还望大家予以指正!如有疏漏、错误之处也请一并指出,多谢!

转自:http://blog.oasisfeng.com/2006/10/19/full-cjk-unicode-range/ [/B]


Yes!Surfer

使用道具 举报

回复
论坛徽章:
29
生肖徽章:兔
日期:2007-05-13 17:26:40ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44会员2007贡献徽章
日期:2007-09-26 18:42:10生肖徽章:兔
日期:2007-09-26 17:11:48生肖徽章:虎
日期:2007-09-26 12:38:09生肖徽章:马
日期:2007-09-26 12:37:12生肖徽章:鸡
日期:2007-09-26 12:36:45生肖徽章:猪
日期:2007-09-26 12:36:34生肖徽章:狗
日期:2007-09-26 12:35:47生肖徽章:兔
日期:2007-09-26 12:33:52
18#
发表于 2007-8-24 21:19 | 只看该作者
俺也去学下

使用道具 举报

回复
论坛徽章:
138
19#
 楼主| 发表于 2007-8-24 21:19 | 只看该作者
13楼50分,15楼50分!
同时再次感谢Yes!Surfer!

这个问题我头痛好长时间了!!!

使用道具 举报

回复
论坛徽章:
138
20#
 楼主| 发表于 2007-8-24 21:49 | 只看该作者
希望版主能帮忙转到 WEB程序开发  讨论区。谢谢!

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表