Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
20f8f3ee
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
20f8f3ee
编写于
4月 05, 2010
作者:
A
asaha
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
4378eb62
fbcdf38e
变更
50
展开全部
隐藏空白更改
内联
并排
Showing
50 changed file
with
37653 addition
and
19635 deletion
+37653
-19635
make/sun/nio/cs/FILES_java.gmk
make/sun/nio/cs/FILES_java.gmk
+5
-5
make/sun/nio/cs/Makefile
make/sun/nio/cs/Makefile
+3
-1
make/tools/CharsetMapping/Big5.c2b
make/tools/CharsetMapping/Big5.c2b
+8
-0
make/tools/CharsetMapping/Big5.map
make/tools/CharsetMapping/Big5.map
+13837
-0
make/tools/CharsetMapping/Big5.nr
make/tools/CharsetMapping/Big5.nr
+5
-0
make/tools/CharsetMapping/HKSCS2001.c2b
make/tools/CharsetMapping/HKSCS2001.c2b
+2187
-0
make/tools/CharsetMapping/HKSCS2001.map
make/tools/CharsetMapping/HKSCS2001.map
+4821
-0
make/tools/CharsetMapping/HKSCS2008.c2b
make/tools/CharsetMapping/HKSCS2008.c2b
+4969
-0
make/tools/CharsetMapping/HKSCS2008.map
make/tools/CharsetMapping/HKSCS2008.map
+5019
-0
make/tools/CharsetMapping/HKSCS_XP.c2b
make/tools/CharsetMapping/HKSCS_XP.c2b
+529
-0
make/tools/CharsetMapping/HKSCS_XP.map
make/tools/CharsetMapping/HKSCS_XP.map
+4704
-0
make/tools/CharsetMapping/dbcs
make/tools/CharsetMapping/dbcs
+1
-0
make/tools/src/build/tools/charsetmapping/DBCS.java
make/tools/src/build/tools/charsetmapping/DBCS.java
+37
-88
make/tools/src/build/tools/charsetmapping/EUC_TW.java
make/tools/src/build/tools/charsetmapping/EUC_TW.java
+177
-0
make/tools/src/build/tools/charsetmapping/GenerateMapping.java
...tools/src/build/tools/charsetmapping/GenerateMapping.java
+0
-95
make/tools/src/build/tools/charsetmapping/HKSCS.java
make/tools/src/build/tools/charsetmapping/HKSCS.java
+190
-0
make/tools/src/build/tools/charsetmapping/JIS0213.java
make/tools/src/build/tools/charsetmapping/JIS0213.java
+69
-96
make/tools/src/build/tools/charsetmapping/Main.java
make/tools/src/build/tools/charsetmapping/Main.java
+7
-11
make/tools/src/build/tools/charsetmapping/SBCS.java
make/tools/src/build/tools/charsetmapping/SBCS.java
+12
-12
make/tools/src/build/tools/charsetmapping/Utils.java
make/tools/src/build/tools/charsetmapping/Utils.java
+221
-0
src/share/classes/sun/awt/HKSCS.java
src/share/classes/sun/awt/HKSCS.java
+1
-1
src/share/classes/sun/io/ByteToCharBig5.java
src/share/classes/sun/io/ByteToCharBig5.java
+5
-7
src/share/classes/sun/io/ByteToCharBig5_HKSCS.java
src/share/classes/sun/io/ByteToCharBig5_HKSCS.java
+18
-5
src/share/classes/sun/io/ByteToCharBig5_Solaris.java
src/share/classes/sun/io/ByteToCharBig5_Solaris.java
+9
-39
src/share/classes/sun/io/ByteToCharHKSCS.java
src/share/classes/sun/io/ByteToCharHKSCS.java
+0
-48
src/share/classes/sun/io/ByteToCharMS950_HKSCS.java
src/share/classes/sun/io/ByteToCharMS950_HKSCS.java
+17
-5
src/share/classes/sun/io/CharToByteBig5.java
src/share/classes/sun/io/CharToByteBig5.java
+5
-5
src/share/classes/sun/io/CharToByteBig5_HKSCS.java
src/share/classes/sun/io/CharToByteBig5_HKSCS.java
+8
-5
src/share/classes/sun/io/CharToByteBig5_Solaris.java
src/share/classes/sun/io/CharToByteBig5_Solaris.java
+8
-35
src/share/classes/sun/io/CharToByteHKSCS_2001.java
src/share/classes/sun/io/CharToByteHKSCS_2001.java
+0
-48
src/share/classes/sun/io/CharToByteMS950_HKSCS.java
src/share/classes/sun/io/CharToByteMS950_HKSCS.java
+9
-5
src/share/classes/sun/nio/cs/ext/Big5.java
src/share/classes/sun/nio/cs/ext/Big5.java
+0
-5508
src/share/classes/sun/nio/cs/ext/Big5_HKSCS.java
src/share/classes/sun/nio/cs/ext/Big5_HKSCS.java
+20
-20
src/share/classes/sun/nio/cs/ext/Big5_HKSCS_2001.java
src/share/classes/sun/nio/cs/ext/Big5_HKSCS_2001.java
+85
-0
src/share/classes/sun/nio/cs/ext/Big5_Solaris.java
src/share/classes/sun/nio/cs/ext/Big5_Solaris.java
+63
-76
src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java
src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java
+15
-2
src/share/classes/sun/nio/cs/ext/HKSCS.java
src/share/classes/sun/nio/cs/ext/HKSCS.java
+312
-5543
src/share/classes/sun/nio/cs/ext/HKSCS_2001.java
src/share/classes/sun/nio/cs/ext/HKSCS_2001.java
+0
-7827
src/share/classes/sun/nio/cs/ext/MS950_HKSCS.java
src/share/classes/sun/nio/cs/ext/MS950_HKSCS.java
+16
-28
src/share/classes/sun/nio/cs/ext/MS950_HKSCS_XP.java
src/share/classes/sun/nio/cs/ext/MS950_HKSCS_XP.java
+102
-0
src/share/native/java/lang/System.c
src/share/native/java/lang/System.c
+12
-9
src/share/native/java/lang/java_props.h
src/share/native/java/lang/java_props.h
+14
-5
src/solaris/classes/sun/awt/fontconfigs/solaris.fontconfig.properties
...classes/sun/awt/fontconfigs/solaris.fontconfig.properties
+1
-1
src/solaris/native/java/lang/java_props_md.c
src/solaris/native/java/lang/java_props_md.c
+22
-14
src/windows/classes/sun/awt/windows/fontconfig.properties
src/windows/classes/sun/awt/windows/fontconfig.properties
+6
-0
src/windows/native/java/lang/ProcessImpl_md.c
src/windows/native/java/lang/ProcessImpl_md.c
+23
-46
src/windows/native/java/lang/java_props_md.c
src/windows/native/java/lang/java_props_md.c
+53
-37
test/java/lang/ProcessBuilder/Basic.java
test/java/lang/ProcessBuilder/Basic.java
+26
-3
test/java/nio/charset/Charset/NIOCharsetAvailabilityTest.java
.../java/nio/charset/Charset/NIOCharsetAvailabilityTest.java
+1
-3
test/java/nio/charset/Charset/RegisteredCharsets.java
test/java/nio/charset/Charset/RegisteredCharsets.java
+1
-2
未找到文件。
make/sun/nio/cs/FILES_java.gmk
浏览文件 @
20f8f3ee
...
@@ -42,8 +42,6 @@ FILES_src = \
...
@@ -42,8 +42,6 @@ FILES_src = \
sun/io/ByteToCharBig5_Solaris.java \
sun/io/ByteToCharBig5_Solaris.java \
sun/io/ByteToCharBig5_HKSCS.java \
sun/io/ByteToCharBig5_HKSCS.java \
sun/io/ByteToCharMS950_HKSCS.java \
sun/io/ByteToCharMS950_HKSCS.java \
sun/io/ByteToCharHKSCS.java \
sun/io/ByteToCharHKSCS_2001.java \
sun/io/ByteToCharGB18030.java \
sun/io/ByteToCharGB18030.java \
sun/io/ByteToCharGB18030DB.java \
sun/io/ByteToCharGB18030DB.java \
sun/io/ByteToCharCp037.java \
sun/io/ByteToCharCp037.java \
...
@@ -173,8 +171,6 @@ FILES_src = \
...
@@ -173,8 +171,6 @@ FILES_src = \
sun/io/CharToByteBig5.java \
sun/io/CharToByteBig5.java \
sun/io/CharToByteBig5_Solaris.java \
sun/io/CharToByteBig5_Solaris.java \
sun/io/CharToByteBig5_HKSCS.java \
sun/io/CharToByteBig5_HKSCS.java \
sun/io/CharToByteHKSCS.java \
sun/io/CharToByteHKSCS_2001.java \
sun/io/CharToByteMS950_HKSCS.java \
sun/io/CharToByteMS950_HKSCS.java \
sun/io/CharToByteGB18030.java \
sun/io/CharToByteGB18030.java \
sun/io/CharToByteCp037.java \
sun/io/CharToByteCp037.java \
...
@@ -374,6 +370,9 @@ FILES_gen_extcs = \
...
@@ -374,6 +370,9 @@ FILES_gen_extcs = \
sun/nio/cs/ext/MacUkraine.java \
sun/nio/cs/ext/MacUkraine.java \
sun/nio/cs/ext/TIS_620.java \
sun/nio/cs/ext/TIS_620.java \
sun/nio/cs/ext/EUC_TWMapping.java \
sun/nio/cs/ext/EUC_TWMapping.java \
sun/nio/cs/ext/HKSCSMapping.java \
sun/nio/cs/ext/HKSCS2001Mapping.java \
sun/nio/cs/ext/HKSCS_XPMapping.java \
sun/nio/cs/ext/IBM1381.java \
sun/nio/cs/ext/IBM1381.java \
sun/nio/cs/ext/IBM1383.java \
sun/nio/cs/ext/IBM1383.java \
sun/nio/cs/ext/IBM930.java \
sun/nio/cs/ext/IBM930.java \
...
@@ -394,7 +393,8 @@ FILES_gen_extcs = \
...
@@ -394,7 +393,8 @@ FILES_gen_extcs = \
sun/nio/cs/ext/MS936.java \
sun/nio/cs/ext/MS936.java \
sun/nio/cs/ext/MS949.java \
sun/nio/cs/ext/MS949.java \
sun/nio/cs/ext/MS950.java \
sun/nio/cs/ext/MS950.java \
sun/nio/cs/ext/GBK.java
sun/nio/cs/ext/GBK.java \
sun/nio/cs/ext/Big5.java
FILES_java = $(FILES_src) $(FILES_gen_extcs)
FILES_java = $(FILES_src) $(FILES_gen_extcs)
make/sun/nio/cs/Makefile
浏览文件 @
20f8f3ee
...
@@ -93,7 +93,9 @@ $(FILES_genout_extcs): \
...
@@ -93,7 +93,9 @@ $(FILES_genout_extcs): \
$(MKDIR)
-p
$(GENCSEXT)
$(MKDIR)
-p
$(GENCSEXT)
$(BOOT_JAVA_CMD)
-jar
$(CHARSETMAPPING_JARFILE)
$(GENCSDATASRC)
$(GENCSEXT)
extsbcs
$(BOOT_JAVA_CMD)
-jar
$(CHARSETMAPPING_JARFILE)
$(GENCSDATASRC)
$(GENCSEXT)
extsbcs
$(BOOT_JAVA_CMD)
-jar
$(CHARSETMAPPING_JARFILE)
$(GENCSDATASRC)
$(GENCSEXT)
euctw
\
$(BOOT_JAVA_CMD)
-jar
$(CHARSETMAPPING_JARFILE)
$(GENCSDATASRC)
$(GENCSEXT)
euctw
\
$(GENCSSRCDIR)
/GenerateEUC_TW.java
$(GENCSSRCDIR)
/EUC_TW.java
$(BOOT_JAVA_CMD)
-jar
$(CHARSETMAPPING_JARFILE)
$(GENCSDATASRC)
$(GENCSEXT)
hkscs
\
$(GENCSSRCDIR)
/HKSCS.java
$(BOOT_JAVA_CMD)
-jar
$(CHARSETMAPPING_JARFILE)
$(GENCSDATASRC)
$(GENCSEXT)
dbcs
$(BOOT_JAVA_CMD)
-jar
$(CHARSETMAPPING_JARFILE)
$(GENCSDATASRC)
$(GENCSEXT)
dbcs
$(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH)
:
\
$(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH)
:
\
...
...
make/tools/CharsetMapping/Big5.c2b
0 → 100644
浏览文件 @
20f8f3ee
#Add the following 5 characters which are duplicated
#or have conflicts with other characters.
0xA1C4 0xFF3F #REGWARN Fallback 0xA1C4 SPACING UNDERSCORE
0xA2AC 0x2571 #REGWARN Fallback 0xA2AC LT DIAG UP RIGHT TO LOW LEFT
0xA2AD 0x2572 #REGWARN Fallback 0xA2AD LT DIAG UP LEFT TO LOW RIGHT
0xA451 0x5341 #REGWARN Fallback 0xA451 HANGZHOU NUMERAL TEN
0xA4CA 0x5345 #REGWARN Fallback 0xA4CA HANGZHOU NUMERAL THIRTY
#
make/tools/CharsetMapping/Big5.map
0 → 100644
浏览文件 @
20f8f3ee
此差异已折叠。
点击以展开。
make/tools/CharsetMapping/Big5.nr
0 → 100644
浏览文件 @
20f8f3ee
0xA15A 0xFF3F #SPACING UNDERSCORE
0xA1FE 0x2571 #LT DIAG UP RIGHT TO LOW LEFT
0xA240 0x2572 #LT DIAG UP LEFT TO LOW RIGHTG
0xA2CC 0x5341 #HANGHZOU NUMERAL TEN
0xA2CE 0x5345 #HANGZHOU NUMERAL THIRTY
make/tools/CharsetMapping/HKSCS2001.c2b
0 → 100644
浏览文件 @
20f8f3ee
此差异已折叠。
点击以展开。
make/tools/CharsetMapping/HKSCS2001.map
0 → 100644
浏览文件 @
20f8f3ee
此差异已折叠。
点击以展开。
make/tools/CharsetMapping/HKSCS2008.c2b
0 → 100644
浏览文件 @
20f8f3ee
此差异已折叠。
点击以展开。
make/tools/CharsetMapping/HKSCS2008.map
0 → 100644
浏览文件 @
20f8f3ee
此差异已折叠。
点击以展开。
make/tools/CharsetMapping/HKSCS_XP.c2b
0 → 100644
浏览文件 @
20f8f3ee
# Generated from HKSCS.Encoder
#
0xFA45 0xE005
0xFA48 0xE008
0xFA68 0xE028
0xFA6B 0xE02B
0xFAA5 0xE043
0xFACC 0xE06A
0xFACD 0xE06B
0xFAD0 0xE06E
0xFAE0 0xE07E
0xFAE8 0xE086
0xFAFA 0xE098
0xFAFD 0xE09B
0xFB43 0xE0A0
0xFB4B 0xE0A8
0xFB5E 0xE0BB
0xFB65 0xE0C2
0xFB70 0xE0CD
0xFB7A 0xE0D7
0xFB7D 0xE0DA
0xFBB6 0xE0F1
0xFBB9 0xE0F4
0xFBBF 0xE0FA
0xFBC1 0xE0FC
0xFBC9 0xE104
0xFBCA 0xE105
0xFBD3 0xE10E
0xFBDC 0xE117
0xFBEA 0xE125
0xFBEF 0xE12A
0xFBF0 0xE12B
0xFC42 0xE13C
0xFC49 0xE143
0xFC4A 0xE144
0xFC59 0xE153
0xFC64 0xE15E
0xFC65 0xE15F
0xFC66 0xE160
0xFC6A 0xE164
0xFCA6 0xE17E
0xFCB4 0xE18C
0xFCC2 0xE19A
0xFCC4 0xE19C
0xFCCF 0xE1A7
0xFCD1 0xE1A9
0xFCEE 0xE1C6
0xFCF7 0xE1CF
0xFD49 0xE1E0
0xFD4A 0xE1E1
0xFD4C 0xE1E3
0xFD50 0xE1E7
0xFD53 0xE1EA
0xFD5D 0xE1F4
0xFD61 0xE1F8
0xFD6C 0xE203
0xFD7A 0xE211
0xFDA2 0xE217
0xFDA3 0xE218
0xFDC4 0xE239
0xFDCA 0xE23F
0xFDCE 0xE243
0xFDD1 0xE246
0xFDE8 0xE25D
0xFDE9 0xE25E
0xFE4D 0xE281
0xFE56 0xE28A
0xFE64 0xE298
0xFE6E 0xE2A2
0xFE78 0xE2AC
0xFE7D 0xE2B1
0xFEB6 0xE2C8
0xFEC5 0xE2D7
0xFEFB 0xE30D
0x8E45 0xE316
0x8E55 0xE326
0x8E59 0xE32A
0x8E6B 0xE33C
0x8EA2 0xE351
0x8EAF 0xE35E
0x8EB9 0xE368
0x8EC7 0xE376
0x8EC9 0xE378
0x8ED8 0xE387
0x8EED 0xE39C
0x8EFE 0xE3AD
0x8F45 0xE3B3
0x8F50 0xE3BE
0x8F54 0xE3C2
0x8F59 0xE3C7
0x8F5D 0xE3CB
0x8F63 0xE3D1
0x8F64 0xE3D2
0x8F70 0xE3DE
0x8F74 0xE3E2
0x8F76 0xE3E4
0x8F7A 0xE3E8
0x8F7C 0xE3EA
0x8FA9 0xE3F5
0x8FAB 0xE3F7
0x8FBA 0xE406
0x8FC2 0xE40E
0x8FDB 0xE427
0x8FEB 0xE437
0x8FF1 0xE43D
0x8FFD 0xE449
0x9044 0xE44F
0x9055 0xE460
0x9060 0xE46B
0x906F 0xE47A
0x90AA 0xE493
0x90B7 0xE4A0
0x90BC 0xE4A5
0x90C0 0xE4A9
0x90C9 0xE4B2
0x90D5 0xE4BE
0x90D6 0xE4BF
0x90D7 0xE4C0
0x90F5 0xE4DE
0x90FA 0xE4E3
0x90FC 0xE4E5
0x9145 0xE4ED
0x914F 0xE4F7
0x9158 0xE500
0x915F 0xE507
0x9166 0xE50E
0x91AE 0xE534
0x91B3 0xE539
0x91B4 0xE53A
0x91B5 0xE53B
0x91B7 0xE53D
0x91BB 0xE541
0x91CD 0xE553
0x91E3 0xE569
0x91EE 0xE574
0x91F2 0xE578
0x91F5 0xE57B
0x91F9 0xE57F
0x924C 0xE591
0x9251 0xE596
0x9252 0xE597
0x9253 0xE598
0x9257 0xE59C
0x9269 0xE5AE
0x9274 0xE5B9
0x9277 0xE5BC
0x92BD 0xE5E0
0x92C9 0xE5EC
0x92D2 0xE5F5
0x92D7 0xE5FA
0x92DB 0xE5FE
0x92E9 0xE60C
0x92FA 0xE61D
0x9347 0xE629
0x934B 0xE62D
0x9357 0xE639
0x9359 0xE63B
0x935B 0xE63D
0x936F 0xE651
0x93A4 0xE664
0x93B5 0xE675
0x93C1 0xE681
0x93C2 0xE682
0x93CD 0xE68D
0x93D4 0xE694
0x93DD 0xE69D
0x93E0 0xE6A0
0x93E4 0xE6A4
0x93E9 0xE6A9
0x93EB 0xE6AB
0x93F6 0xE6B6
0x9449 0xE6C8
0x9463 0xE6E2
0x9464 0xE6E3
0x9469 0xE6E8
0x946E 0xE6ED
0x9470 0xE6EF
0x9472 0xE6F1
0x9475 0xE6F4
0x9479 0xE6F8
0x947E 0xE6FD
0x94A1 0xE6FE
0x94A3 0xE700
0x94B5 0xE712
0x94B9 0xE716
0x94BC 0xE719
0x94C9 0xE726
0x94D1 0xE72E
0x94D3 0xE730
0x94DB 0xE738
0x94DD 0xE73A
0x94DE 0xE73B
0x94EC 0xE749
0x94EF 0xE74C
0x9544 0xE760
0x955A 0xE776
0x9562 0xE77E
0x9564 0xE780
0x9573 0xE78F
0x95B0 0xE7AA
0x95B2 0xE7AC
0x95B3 0xE7AD
0x95B4 0xE7AE
0x95C6 0xE7C0
0x95C7 0xE7C1
0x95CD 0xE7C7
0x95D1 0xE7CB
0x95D6 0xE7D0
0x95DB 0xE7D5
0x95DF 0xE7D9
0x95EC 0xE7E6
0x95F0 0xE7EA
0x95F6 0xE7F0
0x95FC 0xE7F6
0x9641 0xE7FA
0x964D 0xE806
0x965C 0xE815
0x9662 0xE81B
0x9664 0xE81D
0x9669 0xE822
0x966B 0xE824
0x9675 0xE82E
0x9678 0xE831
0x9679 0xE832
0x96A6 0xE83D
0x96A8 0xE83F
0x96B9 0xE850
0x96BC 0xE853
0x96C8 0xE85F
0x96D4 0xE86B
0x96D6 0xE86D
0x96DF 0xE876
0x96E9 0xE880
0x96F7 0xE88E
0x9743 0xE899
0x9745 0xE89B
0x9746 0xE89C
0x975D 0xE8B3
0x9761 0xE8B7
0x9766 0xE8BC
0x977C 0xE8D2
0x97AE 0xE8E2
0x97B0 0xE8E4
0x97B8 0xE8EC
0x97BA 0xE8EE
0x97C0 0xE8F4
0x97C2 0xE8F6
0x97C3 0xE8F7
0x97C5 0xE8F9
0x97C6 0xE8FA
0x97C9 0xE8FD
0x97CD 0xE901
0x97D2 0xE906
0x97D7 0xE90B
0x97DA 0xE90E
0x97DB 0xE90F
0x97DC 0xE910
0x97DD 0xE911
0x97DE 0xE912
0x97E1 0xE915
0x97E7 0xE91B
0x97FD 0xE931
0x97FE 0xE932
0x9853 0xE946
0x9856 0xE949
0x9872 0xE965
0x9879 0xE96C
0x98A8 0xE979
0x98BC 0xE98D
0x98C3 0xE994
0x98C5 0xE996
0x98CB 0xE99C
0x98CC 0xE99D
0x98CD 0xE99E
0x98CE 0xE99F
0x98D0 0xE9A1
0x98D1 0xE9A2
0x98D6 0xE9A7
0x98D9 0xE9AA
0x98DB 0xE9AC
0x98DD 0xE9AE
0x98E4 0xE9B5
0x98E6 0xE9B7
0x98E8 0xE9B9
0x98E9 0xE9BA
0x98EB 0xE9BC
0x98EC 0xE9BD
0x98F4 0xE9C5
0x98FE 0xE9CF
0x9940 0xE9D0
0x9946 0xE9D6
0x9948 0xE9D8
0x994B 0xE9DB
0x994E 0xE9DE
0x9955 0xE9E5
0x9956 0xE9E6
0x9959 0xE9E9
0x995B 0xE9EB
0x9967 0xE9F7
0x996E 0xE9FE
0x9973 0xEA03
0x997A 0xEA0A
0x997B 0xEA0B
0x99A1 0xEA0F
0x99A5 0xEA13
0x99A7 0xEA15
0x99AD 0xEA1B
0x99B3 0xEA21
0x99BC 0xEA2A
0x99C3 0xEA31
0x99C7 0xEA35
0x99CE 0xEA3C
0x99CF 0xEA3D
0x99DE 0xEA4C
0x99E1 0xEA4F
0x99E9 0xEA57
0x99F5 0xEA63
0x99F8 0xEA66
0x9A48 0xEA75
0x9A49 0xEA76
0x9A50 0xEA7D
0x9A55 0xEA82
0x9A58 0xEA85
0x9A5A 0xEA87
0x9A5C 0xEA89
0x9A60 0xEA8D
0x9A63 0xEA90
0x9A6E 0xEA9B
0x9A70 0xEA9D
0x9A79 0xEAA6
0x9A7B 0xEAA8
0x9ABD 0xEAC8
0x9AEC 0xEAF7
0x9B4D 0xEB17
0x9BA9 0xEB51
0x9BAA 0xEB52
0x9BB8 0xEB60
0x9BBE 0xEB66
0x9BC2 0xEB6A
0x9BDF 0xEB87
0x9BE3 0xEB8B
0x9BEA 0xEB92
0x9BEE 0xEB96
0x9C4A 0xEBB1
0x9C5C 0xEBC3
0x9C6F 0xEBD6
0x9C79 0xEBE0
0x9CA1 0xEBE6
0x9CA5 0xEBEA
0x9CBA 0xEBFF
0x9CBB 0xEC00
0x9CBE 0xEC03
0x9CC6 0xEC0B
0x9CC8 0xEC0D
0x9CD1 0xEC16
0x9CF8 0xEC3D
0x9D46 0xEC4A
0x9D49 0xEC4D
0x9D4F 0xEC53
0x9D51 0xEC55
0x9D5D 0xEC61
0x9D73 0xEC77
0x9D78 0xEC7C
0x9D7B 0xEC7F
0x9DA5 0xEC87
0x9DAA 0xEC8C
0x9DAD 0xEC8F
0x9DB5 0xEC97
0x9DCC 0xECAE
0x9DCE 0xECB0
0x9DEE 0xECD0
0x9DF3 0xECD5
0x9E53 0xECF4
0x9E64 0xED05
0x9E7A 0xED1B
0x9E7E 0xED1F
0x9EA4 0xED23
0x9EB4 0xED33
0x9EB8 0xED37
0x9EB9 0xED38
0x9EBB 0xED3A
0x9EC5 0xED44
0x9EC9 0xED48
0x9ECD 0xED4C
0x9EDA 0xED59
0x9EDD 0xED5C
0x9EDE 0xED5D
0x9EDF 0xED5E
0x9EE5 0xED64
0x9EE7 0xED66
0x9EEE 0xED6D
0x9EF0 0xED6F
0x9EFC 0xED7B
0x9F70 0xEDAE
0x9FA5 0xEDC1
0x9FD7 0xEDF3
0x9FD9 0xEDF5
0xA053 0xEE2E
0xA068 0xEE43
0xA06A 0xEE45
0xA06F 0xEE4A
0xA078 0xEE53
0xA07E 0xEE59
0xA0AC 0xEE65
0xA0D0 0xEE89
0xA0DA 0xEE93
0xA0DE 0xEE97
0xA0E6 0xEE9F
0xA0F9 0xEEB2
0x89B7 0xF3F5
0x89BA 0xF3F8
0x89BF 0xF3FD
0x89C5 0xF403
0x89D5 0xF413
0x89D7 0xF415
0x89DA 0xF418
0x89DB 0xF419
0x89DC 0xF41A
0x89E6 0xF424
0x89E8 0xF426
0x89EA 0xF428
0x89ED 0xF42B
0x89EE 0xF42C
0x89EF 0xF42D
0x89F9 0xF437
0x89FB 0xF439
0x89FC 0xF43A
0x89FE 0xF43C
0x8A48 0xF445
0x8A4D 0xF44A
0x8A51 0xF44E
0x8A52 0xF44F
0x8A67 0xF464
0x8A6B 0xF468
0x8A6D 0xF46A
0x8A6E 0xF46B
0x8A76 0xF473
0x8A7D 0xF47A
0x8AAC 0xF487
0x8AAE 0xF489
0x8AB8 0xF493
0x8AB9 0xF494
0x8ABB 0xF496
0x8AC2 0xF49D
0x8AC7 0xF4A2
0x8AD0 0xF4AB
0x8AD1 0xF4AC
0x8AD3 0xF4AE
0x8ADA 0xF4B5
0x8AEB 0xF4C6
0x8AF0 0xF4CB
0x8AFB 0xF4D6
0x8B47 0xF4E1
0x8B60 0xF4FA
0x8B68 0xF502
0x8B6A 0xF504
0x8BA6 0xF51E
0x8BB1 0xF529
0x8BB5 0xF52D
0x8BB6 0xF52E
0x8BB8 0xF530
0x8BBE 0xF536
0x8BC8 0xF540
0x8BCC 0xF544
0x8BDC 0xF554
0x8D63 0xF637
0x8D64 0xF638
0x8D67 0xF63B
0x8D68 0xF63C
0x8D6D 0xF641
0x8D6E 0xF642
0x8D6F 0xF643
0x8D70 0xF644
0x8D74 0xF648
0x8D78 0xF64C
0x8D7D 0xF651
0x8DA1 0xF653
0x8DA6 0xF658
0x8DAB 0xF65D
0x8DAD 0xF65F
0x8DB0 0xF662
0x8DB2 0xF664
0x8DB4 0xF666
0x8DB7 0xF669
0x8DBA 0xF66C
0x8DBB 0xF66D
0x8DBC 0xF66E
0x8DC3 0xF675
0x8DC5 0xF677
0x8DCA 0xF67C
0x8DCC 0xF67E
0x8DD6 0xF688
0x8DDB 0xF68D
0x8DEB 0xF69D
0x8DEF 0xF6A1
0x8DF0 0xF6A2
0x8DF3 0xF6A5
0x8DF5 0xF6A7
0x8DFC 0xF6AE
0x8DFD 0xF6AF
0xC6CD 0xF6DD
0xC8D6 0xF820
0xC8D7 0xF821
0xC8D8 0xF822
0xC8D9 0xF823
0xC8DA 0xF824
0xC8DB 0xF825
0xC8DC 0xF826
0xC8DD 0xF827
0xC8DE 0xF828
0xC8DF 0xF829
0xC8E0 0xF82A
0xC8E1 0xF82B
0xC8E2 0xF82C
0xC8E3 0xF82D
0xC8E4 0xF82E
0xC8E5 0xF82F
0xC8E6 0xF830
0xC8E7 0xF831
0xC8E8 0xF832
0xC8E9 0xF833
0xC8EA 0xF834
0xC8EB 0xF835
0xC8EC 0xF836
0xC8ED 0xF837
0xC8EE 0xF838
0xC8EF 0xF839
0xC8F0 0xF83A
0xC8F1 0xF83B
make/tools/CharsetMapping/HKSCS_XP.map
0 → 100644
浏览文件 @
20f8f3ee
此差异已折叠。
点击以展开。
make/tools/CharsetMapping/dbcs
浏览文件 @
20f8f3ee
#
#
#clzName csName hisName dbtype pkg ascii b1min b1max b2min b2max
#clzName csName hisName dbtype pkg ascii b1min b1max b2min b2max
#
#
Big5 Big5 Big5 basic sun.nio.cs.ext true 0xa1 0xf9 0x40 0xfe
Johab x-Johab x-Johab basic sun.nio.cs.ext true 0x84 0xf9 0x31 0xfe
Johab x-Johab x-Johab basic sun.nio.cs.ext true 0x84 0xf9 0x31 0xfe
EUC_CN GB2312 EUC_CN basic sun.nio.cs.ext true 0xa1 0xf7 0xa1 0xfe
EUC_CN GB2312 EUC_CN basic sun.nio.cs.ext true 0xa1 0xf7 0xa1 0xfe
EUC_KR EUC-KR EUC_KR basic sun.nio.cs.ext true 0xa1 0xfd 0xa1 0xfe
EUC_KR EUC-KR EUC_KR basic sun.nio.cs.ext true 0xa1 0xfd 0xa1 0xfe
...
...
make/tools/src/build/tools/charsetmapping/
Generate
DBCS.java
→
make/tools/src/build/tools/charsetmapping/DBCS.java
浏览文件 @
20f8f3ee
/*
/*
* Copyright 20
09
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 20
10
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -31,12 +31,13 @@ import java.util.Scanner;
...
@@ -31,12 +31,13 @@ import java.util.Scanner;
import
java.util.Formatter
;
import
java.util.Formatter
;
import
java.util.regex.*
;
import
java.util.regex.*
;
import
java.nio.charset.*
;
import
java.nio.charset.*
;
import
static
build
.
tools
.
charsetmapping
.
CharsetMapping
.*;
import
static
build
.
tools
.
charsetmapping
.
Utils
.*;
public
class
Generate
DBCS
{
public
class
DBCS
{
// pattern used by this class to read in mapping table
// pattern used by this class to read in mapping table
static
Pattern
mPattern
=
Pattern
.
compile
(
"(?:0x)?(\\p{XDigit}++)\\s++(?:0x)?(\\p{XDigit}++)(?:\\s++#.*)?"
);
static
Pattern
mPattern
=
Pattern
.
compile
(
"(?:0x)?(\\p{XDigit}++)\\s++(?:0x)?(\\p{XDigit}++)(?:\\s++#.*)?"
);
public
static
void
genDBCS
(
String
args
[])
throws
Exception
{
public
static
void
genClass
(
String
args
[])
throws
Exception
{
Scanner
s
=
new
Scanner
(
new
File
(
args
[
0
],
args
[
2
]));
Scanner
s
=
new
Scanner
(
new
File
(
args
[
0
],
args
[
2
]));
while
(
s
.
hasNextLine
())
{
while
(
s
.
hasNextLine
())
{
...
@@ -63,81 +64,29 @@ public class GenerateDBCS {
...
@@ -63,81 +64,29 @@ public class GenerateDBCS {
int
b2Min
=
toInteger
(
fields
[
8
]);
int
b2Min
=
toInteger
(
fields
[
8
]);
int
b2Max
=
toInteger
(
fields
[
9
]);
int
b2Max
=
toInteger
(
fields
[
9
]);
System
.
out
.
printf
(
"%s,%s,%s,%b,%s%n"
,
clzName
,
csName
,
hisName
,
isASCII
,
pkgName
);
System
.
out
.
printf
(
"%s,%s,%s,%b,%s%n"
,
clzName
,
csName
,
hisName
,
isASCII
,
pkgName
);
genClass
(
args
[
0
],
args
[
1
],
"DoubleByte-X.java.template"
,
genClass
0
(
args
[
0
],
args
[
1
],
"DoubleByte-X.java.template"
,
clzName
,
csName
,
hisName
,
pkgName
,
clzName
,
csName
,
hisName
,
pkgName
,
isASCII
,
type
,
isASCII
,
type
,
b1Min
,
b1Max
,
b2Min
,
b2Max
);
b1Min
,
b1Max
,
b2Min
,
b2Max
);
}
}
}
}
private
static
int
toInteger
(
String
s
)
{
static
int
toInteger
(
String
s
)
{
if
(
s
.
startsWith
(
"0x"
)
||
s
.
startsWith
(
"0X"
))
if
(
s
.
startsWith
(
"0x"
)
||
s
.
startsWith
(
"0X"
))
return
Integer
.
valueOf
(
s
.
substring
(
2
),
16
);
return
Integer
.
valueOf
(
s
.
substring
(
2
),
16
);
else
else
return
Integer
.
valueOf
(
s
);
return
Integer
.
valueOf
(
s
);
}
}
private
static
void
outString
(
Formatter
out
,
private
static
void
genClass0
(
String
srcDir
,
String
dstDir
,
String
template
,
char
[]
cc
,
int
off
,
int
end
,
String
clzName
,
String
closure
)
String
csName
,
{
String
hisName
,
while
(
off
<
end
)
{
String
pkgName
,
out
.
format
(
" \""
);
boolean
isASCII
,
for
(
int
j
=
0
;
j
<
8
;
j
++)
{
String
type
,
if
(
off
==
end
)
int
b1Min
,
int
b1Max
,
break
;
int
b2Min
,
int
b2Max
)
char
c
=
cc
[
off
++];
switch
(
c
)
{
case
'\b'
:
out
.
format
(
"\\b"
);
break
;
case
'\t'
:
out
.
format
(
"\\t"
);
break
;
case
'\n'
:
out
.
format
(
"\\n"
);
break
;
case
'\f'
:
out
.
format
(
"\\f"
);
break
;
case
'\r'
:
out
.
format
(
"\\r"
);
break
;
case
'\"'
:
out
.
format
(
"\\\""
);
break
;
case
'\''
:
out
.
format
(
"\\'"
);
break
;
case
'\\'
:
out
.
format
(
"\\\\"
);
break
;
default
:
out
.
format
(
"\\u%04X"
,
c
&
0xffff
);
}
}
if
(
off
==
end
)
out
.
format
(
"\" %s%n"
,
closure
);
else
out
.
format
(
"\" + %n"
);
}
}
private
static
void
outString
(
Formatter
out
,
char
[]
db
,
int
b1
,
int
b2Min
,
int
b2Max
,
String
closure
)
{
char
[]
cc
=
new
char
[
b2Max
-
b2Min
+
1
];
int
off
=
0
;
for
(
int
b2
=
b2Min
;
b2
<=
b2Max
;
b2
++)
{
cc
[
off
++]
=
db
[(
b1
<<
8
)
|
b2
];
}
outString
(
out
,
cc
,
0
,
cc
.
length
,
closure
);
}
private
static
void
genClass
(
String
srcDir
,
String
dstDir
,
String
template
,
String
clzName
,
String
csName
,
String
hisName
,
String
pkgName
,
boolean
isASCII
,
String
type
,
int
b1Min
,
int
b1Max
,
int
b2Min
,
int
b2Max
)
throws
Exception
throws
Exception
{
{
...
@@ -172,21 +121,21 @@ public class GenerateDBCS {
...
@@ -172,21 +121,21 @@ public class GenerateDBCS {
c2bIndex
[
e
.
cp
>>
8
]
=
1
;
c2bIndex
[
e
.
cp
>>
8
]
=
1
;
}
}
}
}
Formatter
fm
=
new
Formatter
(
b2cSB
);
Output
out
=
new
Output
(
new
Formatter
(
b2cSB
)
);
fm
.
format
(
"%n static final String b2cSBStr =%n"
);
out
.
format
(
"%n static final String b2cSBStr =%n"
);
out
String
(
fm
,
db
,
0x00
,
0x100
,
";"
);
out
.
format
(
db
,
0x00
,
0x100
,
";"
);
fm
.
format
(
"%n static final String[] b2cStr = {%n"
);
out
.
format
(
"%n static final String[] b2cStr = {%n"
);
for
(
int
i
=
0
;
i
<
0x100
;
i
++)
{
for
(
int
i
=
0
;
i
<
0x100
;
i
++)
{
if
(
b2cIndex
[
i
]
==
UNMAPPABLE_DECODING
)
{
if
(
b2cIndex
[
i
]
==
UNMAPPABLE_DECODING
)
{
fm
.
format
(
" null,%n"
);
//unmappable segments
out
.
format
(
" null,%n"
);
//unmappable segments
}
else
{
}
else
{
out
String
(
fm
,
db
,
i
,
b2Min
,
b2Max
,
","
);
out
.
format
(
db
,
i
,
b2Min
,
b2Max
,
","
);
}
}
}
}
fm
.
format
(
" };%n"
);
out
.
format
(
" };%n"
);
fm
.
close
();
out
.
close
();
// (2)now parse the .nr file which includes "b->c" non-roundtrip entries
// (2)now parse the .nr file which includes "b->c" non-roundtrip entries
File
f
=
new
File
(
srcDir
,
clzName
+
".nr"
);
File
f
=
new
File
(
srcDir
,
clzName
+
".nr"
);
...
@@ -201,10 +150,10 @@ public class GenerateDBCS {
...
@@ -201,10 +150,10 @@ public class GenerateDBCS {
sb
.
append
((
char
)
e
.
cp
);
sb
.
append
((
char
)
e
.
cp
);
}
}
char
[]
nr
=
sb
.
toString
().
toCharArray
();
char
[]
nr
=
sb
.
toString
().
toCharArray
();
fm
=
new
Formatter
(
b2cNRSB
);
out
=
new
Output
(
new
Formatter
(
b2cNRSB
)
);
fm
.
format
(
"String b2cNR =%n"
);
out
.
format
(
"String b2cNR =%n"
);
out
String
(
fm
,
nr
,
0
,
nr
.
length
,
";"
);
out
.
format
(
nr
,
0
,
nr
.
length
,
";"
);
fm
.
close
();
out
.
close
();
}
else
{
}
else
{
b2cNRSB
.
append
(
"String b2cNR = null;"
);
b2cNRSB
.
append
(
"String b2cNR = null;"
);
}
}
...
@@ -226,10 +175,10 @@ public class GenerateDBCS {
...
@@ -226,10 +175,10 @@ public class GenerateDBCS {
sb
.
append
((
char
)
e
.
cp
);
sb
.
append
((
char
)
e
.
cp
);
}
}
char
[]
nr
=
sb
.
toString
().
toCharArray
();
char
[]
nr
=
sb
.
toString
().
toCharArray
();
fm
=
new
Formatter
(
c2bNRSB
);
out
=
new
Output
(
new
Formatter
(
c2bNRSB
)
);
fm
.
format
(
"String c2bNR =%n"
);
out
.
format
(
"String c2bNR =%n"
);
out
String
(
fm
,
nr
,
0
,
nr
.
length
,
";"
);
out
.
format
(
nr
,
0
,
nr
.
length
,
";"
);
fm
.
close
();
out
.
close
();
}
else
{
}
else
{
c2bNRSB
.
append
(
"String c2bNR = null;"
);
c2bNRSB
.
append
(
"String c2bNR = null;"
);
}
}
...
@@ -240,15 +189,15 @@ public class GenerateDBCS {
...
@@ -240,15 +189,15 @@ public class GenerateDBCS {
String
c2bNR
=
c2bNRSB
.
toString
();
String
c2bNR
=
c2bNRSB
.
toString
();
Scanner
s
=
new
Scanner
(
new
File
(
srcDir
,
template
));
Scanner
s
=
new
Scanner
(
new
File
(
srcDir
,
template
));
PrintStream
o
ut
=
new
PrintStream
(
new
FileOutputStream
(
PrintStream
o
ps
=
new
PrintStream
(
new
FileOutputStream
(
new
File
(
dstDir
,
clzName
+
".java"
)));
new
File
(
dstDir
,
clzName
+
".java"
)));
if
(
hisName
==
null
)
if
(
hisName
==
null
)
hisName
=
""
;
hisName
=
""
;
while
(
s
.
hasNextLine
())
{
while
(
s
.
hasNextLine
())
{
String
line
=
s
.
nextLine
();
String
line
=
s
.
nextLine
();
if
(
line
.
indexOf
(
"$"
)
==
-
1
)
{
if
(
line
.
indexOf
(
"$"
)
==
-
1
)
{
o
ut
.
println
(
line
);
o
ps
.
println
(
line
);
continue
;
continue
;
}
}
line
=
line
.
replace
(
"$PACKAGE$"
,
pkgName
)
line
=
line
.
replace
(
"$PACKAGE$"
,
pkgName
)
...
@@ -280,8 +229,8 @@ public class GenerateDBCS {
...
@@ -280,8 +229,8 @@ public class GenerateDBCS {
.
replace
(
"$NONROUNDTRIP_B2C$"
,
b2cNR
)
.
replace
(
"$NONROUNDTRIP_B2C$"
,
b2cNR
)
.
replace
(
"$NONROUNDTRIP_C2B$"
,
c2bNR
);
.
replace
(
"$NONROUNDTRIP_C2B$"
,
c2bNR
);
o
ut
.
println
(
line
);
o
ps
.
println
(
line
);
}
}
o
ut
.
close
();
o
ps
.
close
();
}
}
}
}
make/tools/src/build/tools/charsetmapping/
Generate
EUC_TW.java
→
make/tools/src/build/tools/charsetmapping/EUC_TW.java
浏览文件 @
20f8f3ee
/*
/*
* Copyright 20
09
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 20
10
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -31,33 +31,13 @@ import java.util.Scanner;
...
@@ -31,33 +31,13 @@ import java.util.Scanner;
import
java.util.Formatter
;
import
java.util.Formatter
;
import
java.util.regex.*
;
import
java.util.regex.*
;
import
java.nio.charset.*
;
import
java.nio.charset.*
;
import
static
build
.
tools
.
charsetmapping
.
CharsetMapping
.*;
import
static
build
.
tools
.
charsetmapping
.
Utils
.*;
public
class
Generate
EUC_TW
{
public
class
EUC_TW
{
public
static
void
genEUC_TW
(
String
args
[])
throws
Exception
{
static
char
[]
toCharArray
(
int
[]
db
,
genClass
(
new
FileInputStream
(
new
File
(
args
[
0
],
"euc_tw.map"
)),
int
b1Min
,
int
b1Max
,
new
PrintStream
(
new
File
(
args
[
1
],
"EUC_TWMapping.java"
),
"ISO-8859-1"
),
int
b2Min
,
int
b2Max
)
getCopyright
(
new
File
(
args
[
3
])));
}
private
static
String
getCopyright
(
File
f
)
throws
IOException
{
Scanner
s
=
new
Scanner
(
f
,
"ISO-8859-1"
);
StringBuilder
sb
=
new
StringBuilder
();
while
(
s
.
hasNextLine
())
{
String
ln
=
s
.
nextLine
();
sb
.
append
(
ln
+
"\n"
);
// assume we have the copyright as the first comment
if
(
ln
.
matches
(
"^\\s\\*\\/$"
))
break
;
}
s
.
close
();
return
sb
.
toString
();
}
private
static
char
[]
toCharArray
(
int
[]
db
,
int
b1Min
,
int
b1Max
,
int
b2Min
,
int
b2Max
)
{
{
char
[]
ca
=
new
char
[(
b1Max
-
b1Min
+
1
)
*
(
b2Max
-
b2Min
+
1
)];
char
[]
ca
=
new
char
[(
b1Max
-
b1Min
+
1
)
*
(
b2Max
-
b2Min
+
1
)];
int
off
=
0
;
int
off
=
0
;
...
@@ -69,48 +49,9 @@ public class GenerateEUC_TW {
...
@@ -69,48 +49,9 @@ public class GenerateEUC_TW {
return
ca
;
return
ca
;
}
}
private
static
void
toChar
(
Formatter
out
,
String
fmt
,
char
c
)
{
static
char
[]
toCharArray
(
byte
[]
ba
,
switch
(
c
)
{
int
b1Min
,
int
b1Max
,
case
'\b'
:
int
b2Min
,
int
b2Max
)
out
.
format
(
"\\b"
);
break
;
case
'\t'
:
out
.
format
(
"\\t"
);
break
;
case
'\n'
:
out
.
format
(
"\\n"
);
break
;
case
'\f'
:
out
.
format
(
"\\f"
);
break
;
case
'\r'
:
out
.
format
(
"\\r"
);
break
;
case
'\"'
:
out
.
format
(
"\\\""
);
break
;
case
'\''
:
out
.
format
(
"\\'"
);
break
;
case
'\\'
:
out
.
format
(
"\\\\"
);
break
;
default
:
out
.
format
(
fmt
,
c
&
0xffff
);
}
}
private
static
void
toString
(
Formatter
out
,
char
[]
date
,
String
endStr
)
{
int
off
=
0
;
int
end
=
date
.
length
;
while
(
off
<
end
)
{
out
.
format
(
" \""
);
for
(
int
j
=
0
;
j
<
8
&&
off
<
end
;
j
++)
{
toChar
(
out
,
"\\u%04X"
,
date
[
off
++]);
}
if
(
off
==
end
)
out
.
format
(
"\"%s%n"
,
endStr
);
else
out
.
format
(
"\" +%n"
);
}
}
private
static
char
[]
toCharArray
(
byte
[]
ba
,
int
b1Min
,
int
b1Max
,
int
b2Min
,
int
b2Max
)
{
{
char
[]
ca
=
new
char
[(
b1Max
-
b1Min
+
1
)
*
(
b2Max
-
b2Min
+
1
)];
char
[]
ca
=
new
char
[(
b1Max
-
b1Min
+
1
)
*
(
b2Max
-
b2Min
+
1
)];
int
off
=
0
;
int
off
=
0
;
...
@@ -124,18 +65,6 @@ public class GenerateEUC_TW {
...
@@ -124,18 +65,6 @@ public class GenerateEUC_TW {
return
ca
;
return
ca
;
}
}
private
static
void
toCharArray
(
Formatter
out
,
char
[]
date
)
{
int
off
=
0
;
int
end
=
date
.
length
;
while
(
off
<
end
)
{
out
.
format
(
" "
);
for
(
int
j
=
0
;
j
<
8
&&
off
<
end
;
j
++)
{
toChar
(
out
,
"'\\u%04X',"
,
date
[
off
++]);
}
out
.
format
(
"%n"
);
}
}
private
static
int
initC2BIndex
(
char
[]
index
)
{
private
static
int
initC2BIndex
(
char
[]
index
)
{
int
off
=
0
;
int
off
=
0
;
for
(
int
i
=
0
;
i
<
index
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
index
.
length
;
i
++)
{
...
@@ -143,7 +72,7 @@ public class GenerateEUC_TW {
...
@@ -143,7 +72,7 @@ public class GenerateEUC_TW {
index
[
i
]
=
(
char
)
off
;
index
[
i
]
=
(
char
)
off
;
off
+=
0x100
;
off
+=
0x100
;
}
else
{
}
else
{
index
[
i
]
=
CharsetMapping
.
UNMAPPABLE_ENCODING
;
index
[
i
]
=
UNMAPPABLE_ENCODING
;
}
}
}
}
return
off
;
return
off
;
...
@@ -151,9 +80,14 @@ public class GenerateEUC_TW {
...
@@ -151,9 +80,14 @@ public class GenerateEUC_TW {
private
static
Pattern
euctw
=
Pattern
.
compile
(
"(?:8ea)?(\\p{XDigit}++)\\s++(\\p{XDigit}++)?\\s*+.*"
);
private
static
Pattern
euctw
=
Pattern
.
compile
(
"(?:8ea)?(\\p{XDigit}++)\\s++(\\p{XDigit}++)?\\s*+.*"
);
private
static
void
genClass
(
InputStream
is
,
PrintStream
ps
,
String
copyright
)
static
void
genClass
(
String
args
[])
throws
Exception
throws
Exception
{
{
InputStream
is
=
new
FileInputStream
(
new
File
(
args
[
0
],
"euc_tw.map"
));
PrintStream
ps
=
new
PrintStream
(
new
File
(
args
[
1
],
"EUC_TWMapping.java"
),
"ISO-8859-1"
);
String
copyright
=
getCopyright
(
new
File
(
args
[
3
]));
// ranges of byte1 and byte2, something should come from a "config" file
// ranges of byte1 and byte2, something should come from a "config" file
int
b1Min
=
0xa1
;
int
b1Min
=
0xa1
;
int
b1Max
=
0xfe
;
int
b1Max
=
0xfe
;
...
@@ -168,10 +102,10 @@ public class GenerateEUC_TW {
...
@@ -168,10 +102,10 @@ public class GenerateEUC_TW {
for
(
int
i
=
0
;
i
<
8
;
i
++)
for
(
int
i
=
0
;
i
<
8
;
i
++)
for
(
int
j
=
0
;
j
<
0x10000
;
j
++)
for
(
int
j
=
0
;
j
<
0x10000
;
j
++)
db
[
i
][
j
]
=
CharsetMapping
.
UNMAPPABLE_DECODING
;
db
[
i
][
j
]
=
UNMAPPABLE_DECODING
;
CharsetMapping
.
Parser
p
=
new
CharsetMapping
.
Parser
(
is
,
euctw
);
Parser
p
=
new
Parser
(
is
,
euctw
);
CharsetMapping
.
Entry
e
=
null
;
Entry
e
=
null
;
while
((
e
=
p
.
next
())
!=
null
)
{
while
((
e
=
p
.
next
())
!=
null
)
{
int
plane
=
0
;
int
plane
=
0
;
if
(
e
.
bs
>=
0x10000
)
{
if
(
e
.
bs
>=
0x10000
)
{
...
@@ -189,55 +123,52 @@ public class GenerateEUC_TW {
...
@@ -189,55 +123,52 @@ public class GenerateEUC_TW {
}
}
}
}
StringBuilder
out
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
Formatter
fm
=
new
Formatter
(
out
);
Output
out
=
new
Output
(
new
Formatter
(
sb
)
);
fm
.
format
(
copyright
);
out
.
format
(
copyright
);
fm
.
format
(
"%n// -- This file was mechanically generated: Do not edit! -- //%n"
);
out
.
format
(
"%n// -- This file was mechanically generated: Do not edit! -- //%n"
);
fm
.
format
(
"package sun.nio.cs.ext;%n%n"
);
out
.
format
(
"package sun.nio.cs.ext;%n%n"
);
fm
.
format
(
"class EUC_TWMapping {%n%n"
);
out
.
format
(
"class EUC_TWMapping {%n%n"
);
// boundaries
// boundaries
fm
.
format
(
" final static int b1Min = 0x%x;%n"
,
b1Min
);
out
.
format
(
" final static int b1Min = 0x%x;%n"
,
b1Min
);
fm
.
format
(
" final static int b1Max = 0x%x;%n"
,
b1Max
);
out
.
format
(
" final static int b1Max = 0x%x;%n"
,
b1Max
);
fm
.
format
(
" final static int b2Min = 0x%x;%n"
,
b2Min
);
out
.
format
(
" final static int b2Min = 0x%x;%n"
,
b2Min
);
fm
.
format
(
" final static int b2Max = 0x%x;%n"
,
b2Max
);
out
.
format
(
" final static int b2Max = 0x%x;%n"
,
b2Max
);
// b2c tables
// b2c tables
fm
.
format
(
"%n final static String[] b2c = {%n"
);
out
.
format
(
"%n final static String[] b2c = {%n"
);
for
(
int
plane
=
0
;
plane
<
8
;
plane
++)
{
for
(
int
plane
=
0
;
plane
<
8
;
plane
++)
{
fm
.
format
(
" // Plane %d%n"
,
plane
);
out
.
format
(
" // Plane %d%n"
,
plane
);
toString
(
fm
,
toCharArray
(
db
[
plane
],
out
.
format
(
toCharArray
(
db
[
plane
],
b1Min
,
b1Max
,
b2Min
,
b2Max
),
b1Min
,
b1Max
,
b2Min
,
b2Max
),
","
);
","
);
out
.
format
(
"%n"
);
fm
.
format
(
"%n"
);
}
}
fm
.
format
(
" };%n"
);
out
.
format
(
" };%n"
);
// c2bIndex
// c2bIndex
fm
.
format
(
"%n static final int C2BSIZE = 0x%x;%n"
,
out
.
format
(
"%n static final int C2BSIZE = 0x%x;%n"
,
initC2BIndex
(
indexC2B
));
initC2BIndex
(
indexC2B
));
fm
.
format
(
"%n static char[] c2bIndex = new char[] {%n"
);
out
.
format
(
"%n static char[] c2bIndex = new char[] {%n"
);
toCharArray
(
fm
,
indexC2B
);
out
.
format
(
indexC2B
);
fm
.
format
(
" };%n"
);
out
.
format
(
" };%n"
);
// c2bIndexSupp
// c2bIndexSupp
fm
.
format
(
"%n static final int C2BSUPPSIZE = 0x%x;%n"
,
out
.
format
(
"%n static final int C2BSUPPSIZE = 0x%x;%n"
,
initC2BIndex
(
indexC2BSupp
));
initC2BIndex
(
indexC2BSupp
));
fm
.
format
(
"%n static char[] c2bSuppIndex = new char[] {%n"
);
out
.
format
(
"%n static char[] c2bSuppIndex = new char[] {%n"
);
toCharArray
(
fm
,
indexC2BSupp
);
out
.
format
(
indexC2BSupp
);
fm
.
format
(
" };%n"
);
out
.
format
(
" };%n"
);
// suppFlags
// suppFlags
fm
.
format
(
"%n static String b2cIsSuppStr =%n"
);
out
.
format
(
"%n static String b2cIsSuppStr =%n"
);
toString
(
fm
,
toCharArray
(
suppFlag
,
out
.
format
(
toCharArray
(
suppFlag
,
b1Min
,
b1Max
,
b2Min
,
b2Max
),
b1Min
,
b1Max
,
b2Min
,
b2Max
),
";"
);
";"
);
out
.
format
(
"}"
);
out
.
close
();
fm
.
format
(
"}"
);
fm
.
close
();
ps
.
println
(
out
.
toString
());
ps
.
println
(
sb
.
toString
());
ps
.
close
();
ps
.
close
();
}
catch
(
Exception
x
)
{
}
catch
(
Exception
x
)
{
x
.
printStackTrace
();
x
.
printStackTrace
();
...
...
make/tools/src/build/tools/charsetmapping/GenerateMapping.java
已删除
100644 → 0
浏览文件 @
4378eb62
/*
* Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package
build.tools.charsetmapping
;
import
java.io.*
;
import
java.util.regex.*
;
import
static
build
.
tools
.
charsetmapping
.
CharsetMapping
.*;
public
class
GenerateMapping
{
public
static
void
genMapping
(
String
argv
[])
throws
IOException
{
genDataJIS0213
(
new
FileInputStream
(
argv
[
0
]),
new
FileOutputStream
(
argv
[
1
]));
}
// regex pattern to parse the "jis0213.map" file
static
Pattern
sjis0213
=
Pattern
.
compile
(
"0x(\\p{XDigit}++)\\s++U\\+(\\p{XDigit}++)(?:\\+(\\p{XDigit}++))?\\s++#.*"
);
private
static
void
genDataJIS0213
(
InputStream
in
,
OutputStream
out
)
{
int
[]
sb
=
new
int
[
0x100
];
// singlebyte
int
[]
db
=
new
int
[
0x10000
];
// doublebyte
int
[]
indexC2B
=
new
int
[
256
];
Entry
[]
supp
=
new
Entry
[
0x10000
];
Entry
[]
comp
=
new
Entry
[
0x100
];
int
suppTotal
=
0
;
int
compTotal
=
0
;
int
b1Min1
=
0x81
;
int
b1Max1
=
0x9f
;
int
b1Min2
=
0xe0
;
int
b1Max2
=
0xfc
;
int
b2Min
=
0x40
;
int
b2Max
=
0xfe
;
//init
for
(
int
i
=
0
;
i
<
0x80
;
i
++)
sb
[
i
]
=
i
;
for
(
int
i
=
0x80
;
i
<
0x100
;
i
++)
sb
[
i
]
=
UNMAPPABLE_DECODING
;
for
(
int
i
=
0
;
i
<
0x10000
;
i
++)
db
[
i
]
=
UNMAPPABLE_DECODING
;
try
{
Parser
p
=
new
Parser
(
in
,
sjis0213
);
Entry
e
=
null
;
while
((
e
=
p
.
next
())
!=
null
)
{
if
(
e
.
cp2
!=
0
)
{
comp
[
compTotal
++]
=
e
;
}
else
{
if
(
e
.
cp
<=
0xffff
)
{
if
(
e
.
bs
<=
0xff
)
sb
[
e
.
bs
]
=
e
.
cp
;
else
db
[
e
.
bs
]
=
e
.
cp
;
indexC2B
[
e
.
cp
>>
8
]
=
1
;
}
else
{
supp
[
suppTotal
++]
=
e
;
}
}
}
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
();
// c2b Index Table, always the first one
writeINDEXC2B
(
baos
,
indexC2B
);
writeSINGLEBYTE
(
baos
,
sb
);
writeDOUBLEBYTE1
(
baos
,
db
,
b1Min1
,
b1Max1
,
b2Min
,
b2Max
);
writeDOUBLEBYTE2
(
baos
,
db
,
b1Min2
,
b1Max2
,
b2Min
,
b2Max
);
writeSUPPLEMENT
(
baos
,
supp
,
suppTotal
);
writeCOMPOSITE
(
baos
,
comp
,
compTotal
);
writeSIZE
(
out
,
baos
.
size
());
baos
.
writeTo
(
out
);
out
.
close
();
}
catch
(
Exception
x
)
{
x
.
printStackTrace
();
}
}
}
make/tools/src/build/tools/charsetmapping/HKSCS.java
0 → 100644
浏览文件 @
20f8f3ee
/*
* Copyright 2010 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package
build.tools.charsetmapping
;
import
java.io.*
;
import
java.util.Arrays
;
import
java.util.ArrayList
;
import
java.util.Scanner
;
import
java.util.Formatter
;
import
java.util.regex.*
;
import
java.nio.charset.*
;
import
static
build
.
tools
.
charsetmapping
.
Utils
.*;
public
class
HKSCS
{
// HKSCS2001.map has the third column for "UnicodeAlternate", which
// is for c->b non-roundtrip mapping.
// For HKSCS2008, those non-roundtrip mappings are in .nr file
private
static
Pattern
hkscs
=
Pattern
.
compile
(
"(?:0x)?+(\\p{XDigit}++)\\s++(?:0x|U\\+)?+(\\p{XDigit}++)?\\s*+(?:0x|U\\+)?(\\p{XDigit}++)?\\s*+.*"
);
static
void
genClass
(
String
args
[])
throws
Exception
{
// hkscs2008
genClass0
(
new
FileInputStream
(
new
File
(
args
[
0
],
"HKSCS2008.map"
)),
new
FileInputStream
(
new
File
(
args
[
0
],
"HKSCS2008.c2b"
)),
new
PrintStream
(
new
File
(
args
[
1
],
"HKSCSMapping.java"
),
"ISO-8859-1"
),
"HKSCSMapping"
,
getCopyright
(
new
File
(
args
[
3
])));
// xp2001
genClass0
(
new
FileInputStream
(
new
File
(
args
[
0
],
"HKSCS_XP.map"
)),
null
,
new
PrintStream
(
new
File
(
args
[
1
],
"HKSCS_XPMapping.java"
),
"ISO-8859-1"
),
"HKSCS_XPMapping"
,
getCopyright
(
new
File
(
args
[
3
])));
// hkscs2001
genClass0
(
new
FileInputStream
(
new
File
(
args
[
0
],
"HKSCS2001.map"
)),
new
FileInputStream
(
new
File
(
args
[
0
],
"HKSCS2001.c2b"
)),
new
PrintStream
(
new
File
(
args
[
1
],
"HKSCS2001Mapping.java"
),
"ISO-8859-1"
),
"HKSCS2001Mapping"
,
getCopyright
(
new
File
(
args
[
3
])));
}
static
void
genClass0
(
InputStream
isB2C
,
InputStream
isC2B
,
PrintStream
ps
,
String
clzName
,
String
copyright
)
throws
Exception
{
// ranges of byte1 and byte2, something should come from a "config" file
int
b1Min
=
0x87
;
int
b1Max
=
0xfe
;
int
b2Min
=
0x40
;
int
b2Max
=
0xfe
;
try
{
char
[]
bmp
=
new
char
[
0x10000
];
char
[]
supp
=
new
char
[
0x10000
];
boolean
[]
b2cBmp
=
new
boolean
[
0x100
];
boolean
[]
b2cSupp
=
new
boolean
[
0x100
];
// pua should be in range of e000-f8ff. Expand
// it to 0xf93b becase the hkscs2001.c2b has
// the f920-f93b filled
//char[] pua = new char[0xF8FF - 0xE000 + 1];
char
[]
pua
=
new
char
[
0xF93b
-
0xE000
+
1
];
boolean
hasSupp
=
false
;
boolean
hasPua
=
false
;
Arrays
.
fill
(
bmp
,
UNMAPPABLE_DECODING
);
Arrays
.
fill
(
supp
,
UNMAPPABLE_DECODING
);
Arrays
.
fill
(
pua
,
UNMAPPABLE_DECODING
);
Parser
p
=
new
Parser
(
isB2C
,
hkscs
);
Entry
e
=
null
;
while
((
e
=
p
.
next
())
!=
null
)
{
if
(
e
.
cp
>=
0x10000
)
{
supp
[
e
.
bs
]
=
(
char
)
e
.
cp
;
b2cSupp
[
e
.
bs
>>
8
]
=
true
;
hasSupp
=
true
;
}
else
{
bmp
[
e
.
bs
]
=
(
char
)
e
.
cp
;
b2cBmp
[
e
.
bs
>>
8
]
=
true
;
}
if
(
e
.
cp2
!=
0
&&
e
.
cp2
>=
0xe000
&&
e
.
cp2
<=
0xf8ff
)
{
hasPua
=
true
;
pua
[
e
.
cp2
-
0xE000
]
=
(
char
)
e
.
bs
;
}
}
if
(
isC2B
!=
null
)
{
p
=
new
Parser
(
isC2B
,
hkscs
);
e
=
null
;
while
((
e
=
p
.
next
())
!=
null
)
{
pua
[
e
.
cp
-
0xE000
]
=
(
char
)
e
.
bs
;
}
hasPua
=
true
;
}
StringBuilder
sb
=
new
StringBuilder
();
Output
out
=
new
Output
(
new
Formatter
(
sb
));
out
.
format
(
copyright
);
out
.
format
(
"%n// -- This file was mechanically generated: Do not edit! -- //%n"
);
out
.
format
(
"package sun.nio.cs.ext;%n%n"
);
out
.
format
(
"class %s {%n%n"
,
clzName
);
/* hardcoded in sun.nio.cs.ext.HKSCS.java
out.format(" final static int b1Min = 0x%x;%n", b1Min);
out.format(" final static int b1Max = 0x%x;%n", b1Max);
out.format(" final static int b2Min = 0x%x;%n", b2Min);
out.format(" final static int b2Max = 0x%x;%n", b2Max);
*/
// bmp tables
out
.
format
(
"%n static final String[] b2cBmpStr = new String[] {%n"
);
for
(
int
i
=
0
;
i
<
0x100
;
i
++)
{
if
(
b2cBmp
[
i
])
out
.
format
(
bmp
,
i
,
b2Min
,
b2Max
,
","
);
else
out
.
format
(
" null,%n"
);
//unmappable segments
}
out
.
format
(
" };%n"
);
// supp tables
out
.
format
(
"%n static final String[] b2cSuppStr ="
);
if
(
hasSupp
)
{
out
.
format
(
" new String[] {%n"
);
for
(
int
i
=
0
;
i
<
0x100
;
i
++)
{
if
(
b2cSupp
[
i
])
out
.
format
(
supp
,
i
,
b2Min
,
b2Max
,
","
);
else
out
.
format
(
" null,%n"
);
//unmappable segments
}
out
.
format
(
" };%n"
);
}
else
{
out
.
format
(
" null;%n"
);
}
// private area tables
out
.
format
(
"%n final static String pua ="
);
if
(
hasPua
)
{
out
.
format
(
"%n"
);
out
.
format
(
pua
,
0
,
pua
.
length
,
";"
);
}
else
{
out
.
format
(
" null;%n"
);
}
out
.
format
(
"%n"
);
out
.
format
(
"}"
);
out
.
close
();
ps
.
println
(
sb
.
toString
());
ps
.
close
();
}
catch
(
Exception
x
)
{
x
.
printStackTrace
();
}
}
}
make/tools/src/build/tools/charsetmapping/
CharsetMapping
.java
→
make/tools/src/build/tools/charsetmapping/
JIS0213
.java
浏览文件 @
20f8f3ee
...
@@ -25,29 +25,71 @@
...
@@ -25,29 +25,71 @@
package
build.tools.charsetmapping
;
package
build.tools.charsetmapping
;
import
java.io.InputStream
;
import
java.io.*
;
import
java.io.InputStreamReader
;
import
java.util.regex.*
;
import
java.io.OutputStream
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.*
;
import
java.util.*
;
import
static
build
.
tools
.
charsetmapping
.
Utils
.*;
public
class
CharsetMapping
{
public
class
JIS0213
{
public
final
static
char
UNMAPPABLE_DECODING
=
'\
uFFFD
'
;
public
final
static
int
UNMAPPABLE_ENCODING
=
0xFFFD
;
public
static
class
Entry
{
// regex pattern to parse the "jis0213.map" file
public
int
bs
;
//byte sequence reps
static
Pattern
sjis0213
=
Pattern
.
compile
(
"0x(\\p{XDigit}++)\\s++U\\+(\\p{XDigit}++)(?:\\+(\\p{XDigit}++))?\\s++#.*"
);
public
int
cp
;
//Unicode codepoint
public
int
cp2
;
//CC of composite
public
Entry
()
{}
static
void
genClass
(
String
argv
[])
throws
IOException
public
Entry
(
int
bytes
,
int
cp
,
int
cp2
)
{
{
this
.
bs
=
bytes
;
InputStream
in
=
new
FileInputStream
(
argv
[
0
])
;
this
.
cp
=
cp
;
OutputStream
out
=
new
FileOutputStream
(
argv
[
1
]);
this
.
cp2
=
cp2
;
int
[]
sb
=
new
int
[
0x100
];
// singlebyte
int
[]
db
=
new
int
[
0x10000
];
// doublebyte
int
[]
indexC2B
=
new
int
[
256
];
Entry
[]
supp
=
new
Entry
[
0x10000
];
Entry
[]
comp
=
new
Entry
[
0x100
];
int
suppTotal
=
0
;
int
compTotal
=
0
;
int
b1Min1
=
0x81
;
int
b1Max1
=
0x9f
;
int
b1Min2
=
0xe0
;
int
b1Max2
=
0xfc
;
int
b2Min
=
0x40
;
int
b2Max
=
0xfe
;
//init
for
(
int
i
=
0
;
i
<
0x80
;
i
++)
sb
[
i
]
=
i
;
for
(
int
i
=
0x80
;
i
<
0x100
;
i
++)
sb
[
i
]
=
UNMAPPABLE_DECODING
;
for
(
int
i
=
0
;
i
<
0x10000
;
i
++)
db
[
i
]
=
UNMAPPABLE_DECODING
;
try
{
Parser
p
=
new
Parser
(
in
,
sjis0213
);
Entry
e
=
null
;
while
((
e
=
p
.
next
())
!=
null
)
{
if
(
e
.
cp2
!=
0
)
{
comp
[
compTotal
++]
=
e
;
}
else
{
if
(
e
.
cp
<=
0xffff
)
{
if
(
e
.
bs
<=
0xff
)
sb
[
e
.
bs
]
=
e
.
cp
;
else
db
[
e
.
bs
]
=
e
.
cp
;
indexC2B
[
e
.
cp
>>
8
]
=
1
;
}
else
{
supp
[
suppTotal
++]
=
e
;
}
}
}
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
();
// c2b Index Table, always the first one
writeINDEXC2B
(
baos
,
indexC2B
);
writeSINGLEBYTE
(
baos
,
sb
);
writeDOUBLEBYTE1
(
baos
,
db
,
b1Min1
,
b1Max1
,
b2Min
,
b2Max
);
writeDOUBLEBYTE2
(
baos
,
db
,
b1Min2
,
b1Max2
,
b2Min
,
b2Max
);
writeSUPPLEMENT
(
baos
,
supp
,
suppTotal
);
writeCOMPOSITE
(
baos
,
comp
,
compTotal
);
writeSIZE
(
out
,
baos
.
size
());
baos
.
writeTo
(
out
);
out
.
close
();
}
catch
(
Exception
x
)
{
x
.
printStackTrace
();
}
}
}
}
...
@@ -61,76 +103,6 @@ public class CharsetMapping {
...
@@ -61,76 +103,6 @@ public class CharsetMapping {
}
}
};
};
public
static
class
Parser
{
static
final
Pattern
basic
=
Pattern
.
compile
(
"(?:0x)?(\\p{XDigit}++)\\s++(?:0x)?(\\p{XDigit}++)?\\s*+.*"
);
static
final
int
gBS
=
1
;
static
final
int
gCP
=
2
;
static
final
int
gCP2
=
3
;
BufferedReader
reader
;
boolean
closed
;
Matcher
matcher
;
int
gbs
,
gcp
,
gcp2
;
public
Parser
(
InputStream
in
,
Pattern
p
,
int
gbs
,
int
gcp
,
int
gcp2
)
throws
IOException
{
this
.
reader
=
new
BufferedReader
(
new
InputStreamReader
(
in
));
this
.
closed
=
false
;
this
.
matcher
=
p
.
matcher
(
""
);
this
.
gbs
=
gbs
;
this
.
gcp
=
gcp
;
this
.
gcp2
=
gcp2
;
}
public
Parser
(
InputStream
in
,
Pattern
p
)
throws
IOException
{
this
(
in
,
p
,
gBS
,
gCP
,
gCP2
);
}
public
Parser
(
InputStream
in
)
throws
IOException
{
this
(
in
,
basic
,
gBS
,
gCP
,
gCP2
);
}
protected
boolean
isDirective
(
String
line
)
{
return
line
.
startsWith
(
"#"
);
}
protected
Entry
parse
(
Matcher
matcher
,
Entry
mapping
)
{
mapping
.
bs
=
Integer
.
parseInt
(
matcher
.
group
(
gbs
),
16
);
mapping
.
cp
=
Integer
.
parseInt
(
matcher
.
group
(
gcp
),
16
);
if
(
gcp2
<=
matcher
.
groupCount
()
&&
matcher
.
group
(
gcp2
)
!=
null
)
mapping
.
cp2
=
Integer
.
parseInt
(
matcher
.
group
(
gcp2
),
16
);
else
mapping
.
cp2
=
0
;
return
mapping
;
}
public
Entry
next
()
throws
Exception
{
return
next
(
new
Entry
());
}
// returns null and closes the input stream if the eof has beenreached.
public
Entry
next
(
Entry
mapping
)
throws
Exception
{
if
(
closed
)
return
null
;
String
line
;
while
((
line
=
reader
.
readLine
())
!=
null
)
{
if
(
isDirective
(
line
))
continue
;
matcher
.
reset
(
line
);
if
(!
matcher
.
lookingAt
())
{
//System.out.println("Missed: " + line);
continue
;
}
return
parse
(
matcher
,
mapping
);
}
reader
.
close
();
closed
=
true
;
return
null
;
}
}
// tags of different charset mapping tables
// tags of different charset mapping tables
private
final
static
int
MAP_SINGLEBYTE
=
0x1
;
// 0..256 : c
private
final
static
int
MAP_SINGLEBYTE
=
0x1
;
// 0..256 : c
private
final
static
int
MAP_DOUBLEBYTE1
=
0x2
;
// min..max: c
private
final
static
int
MAP_DOUBLEBYTE1
=
0x2
;
// min..max: c
...
@@ -161,7 +133,7 @@ public class CharsetMapping {
...
@@ -161,7 +133,7 @@ public class CharsetMapping {
}
}
}
}
p
ublic
static
final
void
writeSIZE
(
OutputStream
out
,
int
data
)
p
rivate
static
final
void
writeSIZE
(
OutputStream
out
,
int
data
)
throws
IOException
throws
IOException
{
{
out
.
write
((
data
>>>
24
)
&
0xFF
);
out
.
write
((
data
>>>
24
)
&
0xFF
);
...
@@ -170,7 +142,7 @@ public class CharsetMapping {
...
@@ -170,7 +142,7 @@ public class CharsetMapping {
out
.
write
((
data
)
&
0xFF
);
out
.
write
((
data
)
&
0xFF
);
}
}
p
ublic
static
void
writeINDEXC2B
(
OutputStream
out
,
int
[]
indexC2B
)
p
rivate
static
void
writeINDEXC2B
(
OutputStream
out
,
int
[]
indexC2B
)
throws
IOException
throws
IOException
{
{
writeShort
(
out
,
MAP_INDEXC2B
);
writeShort
(
out
,
MAP_INDEXC2B
);
...
@@ -186,7 +158,7 @@ public class CharsetMapping {
...
@@ -186,7 +158,7 @@ public class CharsetMapping {
}
}
}
}
p
ublic
static
void
writeSINGLEBYTE
(
OutputStream
out
,
int
[]
sb
)
p
rivate
static
void
writeSINGLEBYTE
(
OutputStream
out
,
int
[]
sb
)
throws
IOException
throws
IOException
{
{
writeShortArray
(
out
,
MAP_SINGLEBYTE
,
sb
,
0
,
256
);
writeShortArray
(
out
,
MAP_SINGLEBYTE
,
sb
,
0
,
256
);
...
@@ -212,7 +184,8 @@ public class CharsetMapping {
...
@@ -212,7 +184,8 @@ public class CharsetMapping {
}
}
}
}
}
}
public
static
void
writeDOUBLEBYTE1
(
OutputStream
out
,
private
static
void
writeDOUBLEBYTE1
(
OutputStream
out
,
int
[]
db
,
int
[]
db
,
int
b1Min
,
int
b1Max
,
int
b1Min
,
int
b1Max
,
int
b2Min
,
int
b2Max
)
int
b2Min
,
int
b2Max
)
...
@@ -221,7 +194,7 @@ public class CharsetMapping {
...
@@ -221,7 +194,7 @@ public class CharsetMapping {
writeDOUBLEBYTE
(
out
,
MAP_DOUBLEBYTE1
,
db
,
b1Min
,
b1Max
,
b2Min
,
b2Max
);
writeDOUBLEBYTE
(
out
,
MAP_DOUBLEBYTE1
,
db
,
b1Min
,
b1Max
,
b2Min
,
b2Max
);
}
}
p
ublic
static
void
writeDOUBLEBYTE2
(
OutputStream
out
,
p
rivate
static
void
writeDOUBLEBYTE2
(
OutputStream
out
,
int
[]
db
,
int
[]
db
,
int
b1Min
,
int
b1Max
,
int
b1Min
,
int
b1Max
,
int
b2Min
,
int
b2Max
)
int
b2Min
,
int
b2Max
)
...
@@ -231,7 +204,7 @@ public class CharsetMapping {
...
@@ -231,7 +204,7 @@ public class CharsetMapping {
}
}
// the c2b table is output as well
// the c2b table is output as well
p
ublic
static
void
writeSUPPLEMENT
(
OutputStream
out
,
Entry
[]
supp
,
int
size
)
p
rivate
static
void
writeSUPPLEMENT
(
OutputStream
out
,
Entry
[]
supp
,
int
size
)
throws
IOException
throws
IOException
{
{
writeShort
(
out
,
MAP_SUPPLEMENT
);
writeShort
(
out
,
MAP_SUPPLEMENT
);
...
@@ -256,7 +229,7 @@ public class CharsetMapping {
...
@@ -256,7 +229,7 @@ public class CharsetMapping {
}
}
}
}
p
ublic
static
void
writeCOMPOSITE
(
OutputStream
out
,
Entry
[]
comp
,
int
size
)
p
rivate
static
void
writeCOMPOSITE
(
OutputStream
out
,
Entry
[]
comp
,
int
size
)
throws
IOException
throws
IOException
{
{
writeShort
(
out
,
MAP_COMPOSITE
);
writeShort
(
out
,
MAP_COMPOSITE
);
...
...
make/tools/src/build/tools/charsetmapping/Main.java
浏览文件 @
20f8f3ee
...
@@ -32,23 +32,19 @@ public class Main {
...
@@ -32,23 +32,19 @@ public class Main {
public
static
void
main
(
String
args
[])
throws
Exception
{
public
static
void
main
(
String
args
[])
throws
Exception
{
if
(
args
.
length
<
3
)
{
if
(
args
.
length
<
3
)
{
System
.
out
.
println
(
"Usage: java -jar charsetmapping.jar src dst mType
...
"
);
System
.
out
.
println
(
"Usage: java -jar charsetmapping.jar src dst mType
[copyrightSrc]
"
);
System
.
exit
(
1
);
System
.
exit
(
1
);
}
}
if
(
"sbcs"
.
equals
(
args
[
2
])
||
"extsbcs"
.
equals
(
args
[
2
]))
{
if
(
"sbcs"
.
equals
(
args
[
2
])
||
"extsbcs"
.
equals
(
args
[
2
]))
{
GenerateSBCS
.
genSBCS
(
args
);
SBCS
.
genClass
(
args
);
}
else
if
(
"dbcs"
.
equals
(
args
[
2
]))
{
}
else
if
(
"dbcs"
.
equals
(
args
[
2
]))
{
GenerateDBCS
.
genDBCS
(
args
);
DBCS
.
genClass
(
args
);
}
else
if
(
"euctw"
.
equals
(
args
[
2
]))
{
}
else
if
(
"euctw"
.
equals
(
args
[
2
]))
{
if
(
args
.
length
!=
4
)
{
EUC_TW
.
genClass
(
args
);
System
.
out
.
println
(
"Usage: java -jar charsetmapping.jar srcDir dstDir euctw copyrightSrc"
);
System
.
exit
(
1
);
}
GenerateEUC_TW
.
genEUC_TW
(
args
);
}
else
if
(
"sjis0213"
.
equals
(
args
[
2
]))
{
}
else
if
(
"sjis0213"
.
equals
(
args
[
2
]))
{
GenerateMapping
.
genMapping
(
args
);
JIS0213
.
genClass
(
args
);
}
else
if
(
"hkscs"
.
equals
(
args
[
2
]))
{
HKSCS
.
genClass
(
args
);
}
}
}
}
}
}
make/tools/src/build/tools/charsetmapping/
Generate
SBCS.java
→
make/tools/src/build/tools/charsetmapping/SBCS.java
浏览文件 @
20f8f3ee
...
@@ -32,11 +32,11 @@ import java.util.Scanner;
...
@@ -32,11 +32,11 @@ import java.util.Scanner;
import
java.util.Formatter
;
import
java.util.Formatter
;
import
java.util.regex.*
;
import
java.util.regex.*
;
import
java.nio.charset.*
;
import
java.nio.charset.*
;
import
static
build
.
tools
.
charsetmapping
.
CharsetMapping
.*;
import
static
build
.
tools
.
charsetmapping
.
Utils
.*;
public
class
Generate
SBCS
{
public
class
SBCS
{
public
static
void
gen
SBCS
(
String
args
[])
throws
Exception
{
public
static
void
gen
Class
(
String
args
[])
throws
Exception
{
Scanner
s
=
new
Scanner
(
new
File
(
args
[
0
],
args
[
2
]));
Scanner
s
=
new
Scanner
(
new
File
(
args
[
0
],
args
[
2
]));
while
(
s
.
hasNextLine
())
{
while
(
s
.
hasNextLine
())
{
...
@@ -55,8 +55,8 @@ public class GenerateSBCS {
...
@@ -55,8 +55,8 @@ public class GenerateSBCS {
String
pkgName
=
fields
[
4
];
String
pkgName
=
fields
[
4
];
System
.
out
.
printf
(
"%s,%s,%s,%b,%s%n"
,
clzName
,
csName
,
hisName
,
isASCII
,
pkgName
);
System
.
out
.
printf
(
"%s,%s,%s,%b,%s%n"
,
clzName
,
csName
,
hisName
,
isASCII
,
pkgName
);
genClass
(
args
[
0
],
args
[
1
],
"SingleByte-X.java.template"
,
genClass
0
(
args
[
0
],
args
[
1
],
"SingleByte-X.java.template"
,
clzName
,
csName
,
hisName
,
pkgName
,
isASCII
);
clzName
,
csName
,
hisName
,
pkgName
,
isASCII
);
}
}
}
}
...
@@ -108,13 +108,13 @@ public class GenerateSBCS {
...
@@ -108,13 +108,13 @@ public class GenerateSBCS {
static
Pattern
sbmap
=
Pattern
.
compile
(
"0x(\\p{XDigit}++)\\s++U\\+(\\p{XDigit}++)(\\s++#.*)?"
);
static
Pattern
sbmap
=
Pattern
.
compile
(
"0x(\\p{XDigit}++)\\s++U\\+(\\p{XDigit}++)(\\s++#.*)?"
);
private
static
void
genClass
(
String
srcDir
,
String
dstDir
,
private
static
void
genClass
0
(
String
srcDir
,
String
dstDir
,
String
template
,
String
template
,
String
clzName
,
String
clzName
,
String
csName
,
String
csName
,
String
hisName
,
String
hisName
,
String
pkgName
,
String
pkgName
,
boolean
isASCII
)
boolean
isASCII
)
throws
Exception
throws
Exception
{
{
StringBuilder
b2cSB
=
new
StringBuilder
();
StringBuilder
b2cSB
=
new
StringBuilder
();
...
...
make/tools/src/build/tools/charsetmapping/Utils.java
0 → 100644
浏览文件 @
20f8f3ee
/*
* Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package
build.tools.charsetmapping
;
import
java.io.File
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.io.OutputStream
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.Scanner
;
import
java.util.Formatter
;
public
class
Utils
{
public
final
static
char
UNMAPPABLE_DECODING
=
'\
uFFFD
'
;
public
final
static
int
UNMAPPABLE_ENCODING
=
0xFFFD
;
public
static
class
Entry
{
public
int
bs
;
//byte sequence reps
public
int
cp
;
//Unicode codepoint
public
int
cp2
;
//CC of composite
public
Entry
()
{}
public
Entry
(
int
bytes
,
int
cp
,
int
cp2
)
{
this
.
bs
=
bytes
;
this
.
cp
=
cp
;
this
.
cp2
=
cp2
;
}
}
public
static
class
Parser
{
static
final
Pattern
basic
=
Pattern
.
compile
(
"(?:0x)?(\\p{XDigit}++)\\s++(?:0x)?(\\p{XDigit}++)?\\s*+.*"
);
static
final
int
gBS
=
1
;
static
final
int
gCP
=
2
;
static
final
int
gCP2
=
3
;
BufferedReader
reader
;
boolean
closed
;
Matcher
matcher
;
int
gbs
,
gcp
,
gcp2
;
public
Parser
(
InputStream
in
,
Pattern
p
,
int
gbs
,
int
gcp
,
int
gcp2
)
throws
IOException
{
this
.
reader
=
new
BufferedReader
(
new
InputStreamReader
(
in
));
this
.
closed
=
false
;
this
.
matcher
=
p
.
matcher
(
""
);
this
.
gbs
=
gbs
;
this
.
gcp
=
gcp
;
this
.
gcp2
=
gcp2
;
}
public
Parser
(
InputStream
in
,
Pattern
p
)
throws
IOException
{
this
(
in
,
p
,
gBS
,
gCP
,
gCP2
);
}
public
Parser
(
InputStream
in
)
throws
IOException
{
this
(
in
,
basic
,
gBS
,
gCP
,
gCP2
);
}
protected
boolean
isDirective
(
String
line
)
{
return
line
.
startsWith
(
"#"
);
}
protected
Entry
parse
(
Matcher
matcher
,
Entry
mapping
)
{
mapping
.
bs
=
Integer
.
parseInt
(
matcher
.
group
(
gbs
),
16
);
mapping
.
cp
=
Integer
.
parseInt
(
matcher
.
group
(
gcp
),
16
);
if
(
gcp2
<=
matcher
.
groupCount
()
&&
matcher
.
group
(
gcp2
)
!=
null
)
mapping
.
cp2
=
Integer
.
parseInt
(
matcher
.
group
(
gcp2
),
16
);
else
mapping
.
cp2
=
0
;
return
mapping
;
}
public
Entry
next
()
throws
Exception
{
return
next
(
new
Entry
());
}
// returns null and closes the input stream if the eof has beenreached.
public
Entry
next
(
Entry
mapping
)
throws
Exception
{
if
(
closed
)
return
null
;
String
line
;
while
((
line
=
reader
.
readLine
())
!=
null
)
{
if
(
isDirective
(
line
))
continue
;
matcher
.
reset
(
line
);
if
(!
matcher
.
lookingAt
())
{
//System.out.println("Missed: " + line);
continue
;
}
return
parse
(
matcher
,
mapping
);
}
reader
.
close
();
closed
=
true
;
return
null
;
}
}
public
static
class
Output
{
private
Formatter
out
;
public
Output
(
Formatter
out
)
{
this
.
out
=
out
;
}
public
void
close
()
{
out
.
close
();
}
private
void
toChar
(
String
fmt
,
char
c
)
{
switch
(
c
)
{
case
'\b'
:
out
.
format
(
"\\b"
);
break
;
case
'\t'
:
out
.
format
(
"\\t"
);
break
;
case
'\n'
:
out
.
format
(
"\\n"
);
break
;
case
'\f'
:
out
.
format
(
"\\f"
);
break
;
case
'\r'
:
out
.
format
(
"\\r"
);
break
;
case
'\"'
:
out
.
format
(
"\\\""
);
break
;
case
'\''
:
out
.
format
(
"\\'"
);
break
;
case
'\\'
:
out
.
format
(
"\\\\"
);
break
;
default
:
out
.
format
(
fmt
,
c
&
0xffff
);
}
}
public
void
format
(
String
fmt
,
Object
...
args
)
{
out
.
format
(
fmt
,
args
);
}
public
void
format
(
char
[]
cc
,
int
off
,
int
end
,
String
closure
)
{
while
(
off
<
end
)
{
out
.
format
(
" \""
);
for
(
int
j
=
0
;
j
<
8
;
j
++)
{
if
(
off
==
end
)
break
;
toChar
(
"\\u%04X"
,
cc
[
off
++]);
}
if
(
off
==
end
)
out
.
format
(
"\" %s%n"
,
closure
);
else
out
.
format
(
"\" + %n"
);
}
}
public
void
format
(
char
[]
cc
,
String
closure
)
{
format
(
cc
,
0
,
cc
.
length
,
closure
);
}
public
void
format
(
char
[]
db
,
int
b1
,
int
b2Min
,
int
b2Max
,
String
closure
)
{
char
[]
cc
=
new
char
[
b2Max
-
b2Min
+
1
];
int
off
=
0
;
for
(
int
b2
=
b2Min
;
b2
<=
b2Max
;
b2
++)
{
cc
[
off
++]
=
db
[(
b1
<<
8
)
|
b2
];
}
format
(
cc
,
0
,
cc
.
length
,
closure
);
}
public
void
format
(
char
[]
date
)
{
int
off
=
0
;
int
end
=
date
.
length
;
while
(
off
<
end
)
{
out
.
format
(
" "
);
for
(
int
j
=
0
;
j
<
8
&&
off
<
end
;
j
++)
{
toChar
(
"'\\u%04X',"
,
date
[
off
++]);
}
out
.
format
(
"%n"
);
}
}
}
public
static
String
getCopyright
(
File
f
)
throws
IOException
{
Scanner
s
=
new
Scanner
(
f
,
"ISO-8859-1"
);
StringBuilder
sb
=
new
StringBuilder
();
while
(
s
.
hasNextLine
())
{
String
ln
=
s
.
nextLine
();
sb
.
append
(
ln
+
"\n"
);
// assume we have the copyright as the first comment
if
(
ln
.
matches
(
"^\\s\\*\\/$"
))
break
;
}
s
.
close
();
return
sb
.
toString
();
}
}
src/share/classes/sun/awt/HKSCS.java
浏览文件 @
20f8f3ee
...
@@ -34,7 +34,7 @@ import java.nio.charset.CharsetDecoder;
...
@@ -34,7 +34,7 @@ import java.nio.charset.CharsetDecoder;
ExtendedCharsets class, because if we want to have a public HKSCS,
ExtendedCharsets class, because if we want to have a public HKSCS,
it probably should be HKSCS_2001 not HKSCS.
it probably should be HKSCS_2001 not HKSCS.
*/
*/
public
class
HKSCS
extends
sun
.
nio
.
cs
.
ext
.
HKSCS
{
public
class
HKSCS
extends
sun
.
nio
.
cs
.
ext
.
MS950_HKSCS_XP
{
public
HKSCS
()
{
public
HKSCS
()
{
super
();
super
();
}
}
...
...
src/share/classes/sun/io/ByteToCharBig5.java
浏览文件 @
20f8f3ee
...
@@ -26,26 +26,24 @@
...
@@ -26,26 +26,24 @@
package
sun.io
;
package
sun.io
;
import
sun.nio.cs.ext.DoubleByte
;
import
sun.nio.cs.ext.Big5
;
import
sun.nio.cs.ext.Big5
;
/**
/**
* Tables and data to convert Big5 to Unicode
* Tables and data to convert Big5 to Unicode
*
*
* @author ConverterGenerator tool
*/
*/
public
class
ByteToCharBig5
extends
ByteToCharD
oubleByte
{
public
class
ByteToCharBig5
extends
ByteToCharD
BCS_ASCII
{
private
final
static
Big5
nioCoder
=
new
Big5
();
private
static
DoubleByte
.
Decoder
dec
=
(
DoubleByte
.
Decoder
)
new
Big5
().
newDecoder
();
public
String
getCharacterEncoding
()
{
public
String
getCharacterEncoding
()
{
return
"Big5"
;
return
"Big5"
;
}
}
public
ByteToCharBig5
()
{
public
ByteToCharBig5
()
{
super
.
index1
=
nioCoder
.
getDecoderIndex1
();
super
(
dec
);
super
.
index2
=
nioCoder
.
getDecoderIndex2
();
start
=
0x40
;
end
=
0xFE
;
}
}
}
}
src/share/classes/sun/io/ByteToCharBig5_HKSCS.java
浏览文件 @
20f8f3ee
...
@@ -25,15 +25,28 @@
...
@@ -25,15 +25,28 @@
package
sun.io
;
package
sun.io
;
public
class
ByteToCharBig5_HKSCS
extends
ByteToCharHKSCS_2001
{
import
sun.nio.cs.ext.Big5_HKSCS
;
ByteToCharBig5
bcBig5
=
new
ByteToCharBig5
();
import
sun.nio.cs.ext.HKSCS
;
import
static
sun
.
nio
.
cs
.
CharsetMapping
.*;
public
class
ByteToCharBig5_HKSCS
extends
ByteToCharDBCS_ASCII
{
protected
static
HKSCS
.
Decoder
dec
=
(
HKSCS
.
Decoder
)
new
Big5_HKSCS
().
newDecoder
();
public
String
getCharacterEncoding
()
{
public
String
getCharacterEncoding
()
{
return
"Big5_HKSCS"
;
return
"Big5_HKSCS"
;
}
}
protected
char
getUnicode
(
int
byte1
,
int
byte2
)
{
public
ByteToCharBig5_HKSCS
()
{
char
c
=
super
.
getUnicode
(
byte1
,
byte2
);
super
(
dec
);
return
(
c
!=
REPLACE_CHAR
)
?
c
:
bcBig5
.
getUnicode
(
byte1
,
byte2
);
}
protected
char
decodeDouble
(
int
byte1
,
int
byte2
)
{
char
c
=
dec
.
decodeDouble
(
byte1
,
byte2
);
if
(
c
==
UNMAPPABLE_DECODING
)
c
=
dec
.
decodeBig5
(
byte1
,
byte2
);
return
c
;
}
}
}
}
src/share/classes/sun/io/ByteToCharBig5_Solaris.java
浏览文件 @
20f8f3ee
...
@@ -25,49 +25,19 @@
...
@@ -25,49 +25,19 @@
package
sun.io
;
package
sun.io
;
/*
import
sun.nio.cs.ext.DoubleByte
;
*
import
sun.nio.cs.ext.Big5_Solaris
;
*
*
public
class
ByteToCharBig5_Solaris
extends
ByteToCharDBCS_ASCII
{
*
*/
private
static
DoubleByte
.
Decoder
dec
=
public
class
ByteToCharBig5_Solaris
extends
ByteToCharBig5
{
(
DoubleByte
.
Decoder
)
new
Big5_Solaris
().
newDecoder
();
public
ByteToCharBig5_Solaris
()
{}
public
String
getCharacterEncoding
()
{
public
String
getCharacterEncoding
()
{
return
"Big5_Solaris"
;
return
"Big5_Solaris"
;
}
}
protected
char
getUnicode
(
int
byte1
,
int
byte2
)
{
public
ByteToCharBig5_Solaris
()
{
//
super
(
dec
);
char
c
=
super
.
getUnicode
(
byte1
,
byte2
);
if
(
c
==
REPLACE_CHAR
)
{
if
(
byte1
==
0xf9
)
{
switch
(
byte2
)
{
case
0xD6
:
c
=
(
char
)
0x7881
;
break
;
case
0xD7
:
c
=
(
char
)
0x92B9
;
break
;
case
0xD8
:
c
=
(
char
)
0x88CF
;
break
;
case
0xD9
:
c
=
(
char
)
0x58BB
;
break
;
case
0xDA
:
c
=
(
char
)
0x6052
;
break
;
case
0xDB
:
c
=
(
char
)
0x7CA7
;
break
;
case
0xDC
:
c
=
(
char
)
0x5AFA
;
break
;
}
}
}
return
c
;
}
}
}
}
src/share/classes/sun/io/ByteToCharHKSCS.java
已删除
100644 → 0
浏览文件 @
4378eb62
/*
* Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package
sun.io
;
import
sun.nio.cs.ext.HKSCS
;
/**
* Tables and data to convert HKSCS to Unicode
*
* @author ConverterGenerator tool
*/
public
class
ByteToCharHKSCS
extends
ByteToCharDoubleByte
{
public
String
getCharacterEncoding
()
{
return
"HKSCS"
;
}
public
ByteToCharHKSCS
()
{
super
.
index1
=
HKSCS
.
getDecoderIndex1
();
super
.
index2
=
HKSCS
.
getDecoderIndex2
();
start
=
0x40
;
end
=
0xFE
;
}
}
src/share/classes/sun/io/ByteToCharMS950_HKSCS.java
浏览文件 @
20f8f3ee
...
@@ -25,15 +25,27 @@
...
@@ -25,15 +25,27 @@
package
sun.io
;
package
sun.io
;
public
class
ByteToCharMS950_HKSCS
extends
ByteToCharHKSCS
{
import
sun.nio.cs.ext.HKSCS
;
ByteToCharMS950
bcMS950
=
new
ByteToCharMS950
();
import
sun.nio.cs.ext.MS950_HKSCS
;
import
static
sun
.
nio
.
cs
.
CharsetMapping
.*;
public
class
ByteToCharMS950_HKSCS
extends
ByteToCharDBCS_ASCII
{
private
static
HKSCS
.
Decoder
dec
=
(
HKSCS
.
Decoder
)
new
MS950_HKSCS
().
newDecoder
();
public
String
getCharacterEncoding
()
{
public
String
getCharacterEncoding
()
{
return
"MS950_HKSCS"
;
return
"MS950_HKSCS"
;
}
}
protected
char
getUnicode
(
int
byte1
,
int
byte2
)
{
public
ByteToCharMS950_HKSCS
()
{
char
c
=
super
.
getUnicode
(
byte1
,
byte2
);
super
(
dec
);
return
(
c
!=
REPLACE_CHAR
)
?
c
:
bcMS950
.
decodeDouble
(
byte1
,
byte2
);
}
protected
char
decodeDouble
(
int
byte1
,
int
byte2
)
{
char
c
=
dec
.
decodeDouble
(
byte1
,
byte2
);
if
(
c
==
UNMAPPABLE_DECODING
)
c
=
dec
.
decodeBig5
(
byte1
,
byte2
);
return
c
;
}
}
}
}
src/share/classes/sun/io/CharToByteBig5.java
浏览文件 @
20f8f3ee
...
@@ -26,24 +26,24 @@
...
@@ -26,24 +26,24 @@
package
sun.io
;
package
sun.io
;
import
sun.nio.cs.ext.DoubleByte
;
import
sun.nio.cs.ext.Big5
;
import
sun.nio.cs.ext.Big5
;
/**
/**
* Tables and data to convert Unicode to Big5
* Tables and data to convert Unicode to Big5
*
*
* @author ConverterGenerator tool
*/
*/
public
class
CharToByteBig5
extends
CharToByteD
oubleByte
{
public
class
CharToByteBig5
extends
CharToByteD
BCS_ASCII
{
private
static
final
Big5
nioCoder
=
new
Big5
();
private
static
DoubleByte
.
Encoder
enc
=
(
DoubleByte
.
Encoder
)
new
Big5
().
newEncoder
();
public
String
getCharacterEncoding
()
{
public
String
getCharacterEncoding
()
{
return
"Big5"
;
return
"Big5"
;
}
}
public
CharToByteBig5
()
{
public
CharToByteBig5
()
{
super
.
index1
=
nioCoder
.
getEncoderIndex1
();
super
(
enc
);
super
.
index2
=
nioCoder
.
getEncoderIndex2
();
}
}
}
}
src/share/classes/sun/io/CharToByteBig5_HKSCS.java
浏览文件 @
20f8f3ee
...
@@ -25,15 +25,18 @@
...
@@ -25,15 +25,18 @@
package
sun.io
;
package
sun.io
;
public
class
CharToByteBig5_HKSCS
extends
CharToByteHKSCS_2001
{
import
sun.nio.cs.ext.DoubleByte
;
CharToByteBig5
cbBig5
=
new
CharToByteBig5
();
import
sun.nio.cs.ext.Big5_HKSCS
;
public
class
CharToByteBig5_HKSCS
extends
CharToByteDBCS_ASCII
{
private
static
DoubleByte
.
Encoder
enc
=
(
DoubleByte
.
Encoder
)
new
Big5_HKSCS
().
newEncoder
();
public
String
getCharacterEncoding
()
{
public
String
getCharacterEncoding
()
{
return
"Big5_HKSCS"
;
return
"Big5_HKSCS"
;
}
}
protected
int
getNative
(
char
ch
)
{
public
CharToByteBig5_HKSCS
()
{
int
r
=
super
.
getNative
(
ch
);
super
(
enc
);
return
(
r
!=
0
)
?
r
:
cbBig5
.
getNative
(
ch
);
}
}
}
}
src/share/classes/sun/io/CharToByteBig5_Solaris.java
浏览文件 @
20f8f3ee
...
@@ -23,48 +23,21 @@
...
@@ -23,48 +23,21 @@
* have any questions.
* have any questions.
*/
*/
package
sun.io
;
package
sun.io
;
/**
import
sun.nio.cs.ext.DoubleByte
;
*/
import
sun.nio.cs.ext.Big5_Solaris
;
public
class
CharToByteBig5_Solaris
extends
CharToByteDBCS_ASCII
{
public
class
CharToByteBig5_Solaris
extends
CharToByteBig5
{
private
static
DoubleByte
.
Encoder
enc
=
(
DoubleByte
.
Encoder
)
new
Big5_Solaris
().
newEncoder
();
public
String
getCharacterEncoding
()
{
public
String
getCharacterEncoding
()
{
return
"Big5_Solaris"
;
return
"Big5_Solaris"
;
}
}
protected
int
getNative
(
char
ch
)
{
public
CharToByteBig5_Solaris
()
{
int
nativeVal
;
super
(
enc
);
if
((
nativeVal
=
super
.
getNative
(
ch
))
!=
0
)
{
return
nativeVal
;
}
switch
(
ch
)
{
case
0x7881
:
nativeVal
=
0xF9D6
;
break
;
case
0x92B9
:
nativeVal
=
0xF9D7
;
break
;
case
0x88CF
:
nativeVal
=
0xF9D8
;
break
;
case
0x58BB
:
nativeVal
=
0xF9D9
;
break
;
case
0x6052
:
nativeVal
=
0xF9DA
;
break
;
case
0x7CA7
:
nativeVal
=
0xF9DB
;
break
;
case
0x5AFA
:
nativeVal
=
0xF9DC
;
break
;
}
return
nativeVal
;
}
}
}
}
src/share/classes/sun/io/CharToByteHKSCS_2001.java
已删除
100644 → 0
浏览文件 @
4378eb62
/*
* Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package
sun.io
;
import
sun.nio.cs.ext.HKSCS_2001
;
/**
* Tables and data to convert Unicode to HKSCS (2001 revision)
*
* @author ConverterGenerator tool
*/
public
class
CharToByteHKSCS_2001
extends
CharToByteDoubleByte
{
public
String
getCharacterEncoding
()
{
return
"HKSCS_2001"
;
}
public
CharToByteHKSCS_2001
()
{
super
.
index1
=
HKSCS_2001
.
getEncoderIndex1
();
super
.
index2
=
HKSCS_2001
.
getEncoderIndex2
();
}
}
src/share/classes/sun/io/CharToByteMS950_HKSCS.java
浏览文件 @
20f8f3ee
...
@@ -25,15 +25,19 @@
...
@@ -25,15 +25,19 @@
package
sun.io
;
package
sun.io
;
public
class
CharToByteMS950_HKSCS
extends
CharToByteHKSCS
{
import
sun.nio.cs.ext.DoubleByte
;
CharToByteMS950
cbMS950
=
new
CharToByteMS950
();
import
sun.nio.cs.ext.MS950_HKSCS
;
public
class
CharToByteMS950_HKSCS
extends
CharToByteDBCS_ASCII
{
private
static
DoubleByte
.
Encoder
enc
=
(
DoubleByte
.
Encoder
)
new
MS950_HKSCS
().
newEncoder
();
public
String
getCharacterEncoding
()
{
public
String
getCharacterEncoding
()
{
return
"MS950_HKSCS"
;
return
"MS950_HKSCS"
;
}
}
protected
int
getNative
(
char
ch
)
{
public
CharToByteMS950_HKSCS
()
{
int
r
=
super
.
getNative
(
ch
);
super
(
enc
);
return
(
r
!=
0
)
?
r
:
cbMS950
.
encodeChar
(
ch
);
}
}
}
}
src/share/classes/sun/nio/cs/ext/Big5.java
已删除
100644 → 0
浏览文件 @
4378eb62
此差异已折叠。
点击以展开。
src/share/classes/sun/nio/cs/ext/Big5_HKSCS.java
浏览文件 @
20f8f3ee
/*
/*
* Copyright 20
02-2004
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 20
10
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -23,15 +23,13 @@
...
@@ -23,15 +23,13 @@
* have any questions.
* have any questions.
*/
*/
/*
*/
package
sun.nio.cs.ext
;
package
sun.nio.cs.ext
;
import
java.nio.charset.Charset
;
import
java.nio.charset.Charset
;
import
java.nio.charset.CharsetDecoder
;
import
java.nio.charset.CharsetDecoder
;
import
java.nio.charset.CharsetEncoder
;
import
java.nio.charset.CharsetEncoder
;
import
sun.nio.cs.HistoricallyNamedCharset
;
import
sun.nio.cs.HistoricallyNamedCharset
;
import
static
sun
.
nio
.
cs
.
CharsetMapping
.*;
public
class
Big5_HKSCS
extends
Charset
implements
HistoricallyNamedCharset
public
class
Big5_HKSCS
extends
Charset
implements
HistoricallyNamedCharset
{
{
...
@@ -57,33 +55,35 @@ public class Big5_HKSCS extends Charset implements HistoricallyNamedCharset
...
@@ -57,33 +55,35 @@ public class Big5_HKSCS extends Charset implements HistoricallyNamedCharset
return
new
Encoder
(
this
);
return
new
Encoder
(
this
);
}
}
private
static
class
Decoder
extends
HKSCS_2001
.
Decoder
{
static
class
Decoder
extends
HKSCS
.
Decoder
{
private
static
DoubleByte
.
Decoder
big5
=
(
DoubleByte
.
Decoder
)
new
Big5
().
newDecoder
();
Big5
.
Decoder
big5Dec
;
private
static
char
[][]
b2cBmp
=
new
char
[
0x100
][]
;
private
static
char
[][]
b2cSupp
=
new
char
[
0x100
][];
protected
char
decodeDouble
(
int
byte1
,
int
byte2
)
{
static
{
char
c
=
super
.
decodeDouble
(
byte1
,
byte2
);
initb2c
(
b2cBmp
,
HKSCSMapping
.
b2cBmpStr
);
return
(
c
!=
REPLACE_CHAR
)
?
c
:
big5Dec
.
decodeDouble
(
byte1
,
byte2
);
initb2c
(
b2cSupp
,
HKSCSMapping
.
b2cSuppStr
);
}
}
private
Decoder
(
Charset
cs
)
{
private
Decoder
(
Charset
cs
)
{
super
(
cs
);
super
(
cs
,
big5
,
b2cBmp
,
b2cSupp
);
big5Dec
=
new
Big5
.
Decoder
(
cs
);
}
}
}
}
private
static
class
Encoder
extends
HKSCS_2001
.
Encoder
{
static
class
Encoder
extends
HKSCS
.
Encoder
{
private
static
DoubleByte
.
Encoder
big5
=
private
Big5
.
Encoder
big5Enc
;
(
DoubleByte
.
Encoder
)
new
Big5
().
newEncoder
()
;
protected
int
encodeDouble
(
char
ch
)
{
static
char
[][]
c2bBmp
=
new
char
[
0x100
][];
int
r
=
super
.
encodeDouble
(
ch
);
static
char
[][]
c2bSupp
=
new
char
[
0x100
][];
return
(
r
!=
0
)
?
r
:
big5Enc
.
encodeDouble
(
ch
);
static
{
initc2b
(
c2bBmp
,
HKSCSMapping
.
b2cBmpStr
,
HKSCSMapping
.
pua
);
initc2b
(
c2bSupp
,
HKSCSMapping
.
b2cSuppStr
,
null
);
}
}
private
Encoder
(
Charset
cs
)
{
private
Encoder
(
Charset
cs
)
{
super
(
cs
);
super
(
cs
,
big5
,
c2bBmp
,
c2bSupp
);
big5Enc
=
new
Big5
.
Encoder
(
cs
);
}
}
}
}
}
}
src/share/classes/sun/
io/CharToByteHKSCS
.java
→
src/share/classes/sun/
nio/cs/ext/Big5_HKSCS_2001
.java
浏览文件 @
20f8f3ee
/*
/*
* Copyright 200
1-2003
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 200
2-2004
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -23,26 +23,63 @@
...
@@ -23,26 +23,63 @@
* have any questions.
* have any questions.
*/
*/
package
sun.nio.cs.ext
;
import
java.nio.charset.Charset
;
import
java.nio.charset.CharsetDecoder
;
import
java.nio.charset.CharsetEncoder
;
import
sun.nio.cs.HistoricallyNamedCharset
;
package
sun.io
;
public
class
Big5_HKSCS_2001
extends
Charset
{
public
Big5_HKSCS_2001
()
{
super
(
"x-Big5-HKSCS-2001"
,
ExtendedCharsets
.
aliasesFor
(
"x-Big5-HKSCS-2001"
));
}
import
sun.nio.cs.ext.HKSCS
;
public
boolean
contains
(
Charset
cs
)
{
return
((
cs
.
name
().
equals
(
"US-ASCII"
))
||
(
cs
instanceof
Big5
)
||
(
cs
instanceof
Big5_HKSCS_2001
));
}
/**
public
CharsetDecoder
newDecoder
()
{
* Tables and data to convert Unicode to HKSCS
return
new
Decoder
(
this
);
*
}
* @author ConverterGenerator tool
*/
public
class
CharToByteHKSCS
extends
CharToByteDoubleByte
{
public
CharsetEncoder
newEncoder
()
{
return
new
Encoder
(
this
);
}
private
static
class
Decoder
extends
HKSCS
.
Decoder
{
private
static
DoubleByte
.
Decoder
big5
=
(
DoubleByte
.
Decoder
)
new
Big5
().
newDecoder
();
private
static
char
[][]
b2cBmp
=
new
char
[
0x100
][];
private
static
char
[][]
b2cSupp
=
new
char
[
0x100
][];
static
{
initb2c
(
b2cBmp
,
HKSCS2001Mapping
.
b2cBmpStr
);
initb2c
(
b2cSupp
,
HKSCS2001Mapping
.
b2cSuppStr
);
}
public
String
getCharacterEncoding
()
{
private
Decoder
(
Charset
cs
)
{
return
"HKSCS"
;
super
(
cs
,
big5
,
b2cBmp
,
b2cSupp
);
}
}
}
public
CharToByteHKSCS
()
{
private
static
class
Encoder
extends
HKSCS
.
Encoder
{
super
.
index1
=
HKSCS
.
getEncoderIndex1
();
private
static
DoubleByte
.
Encoder
big5
=
super
.
index2
=
HKSCS
.
getEncoderIndex2
();
(
DoubleByte
.
Encoder
)
new
Big5
().
newEncoder
();
static
char
[][]
c2bBmp
=
new
char
[
0x100
][];
static
char
[][]
c2bSupp
=
new
char
[
0x100
][];
static
{
initc2b
(
c2bBmp
,
HKSCS2001Mapping
.
b2cBmpStr
,
HKSCS2001Mapping
.
pua
);
initc2b
(
c2bSupp
,
HKSCS2001Mapping
.
b2cSuppStr
,
null
);
}
private
Encoder
(
Charset
cs
)
{
super
(
cs
,
big5
,
c2bBmp
,
c2bSupp
);
}
}
}
}
}
src/share/classes/sun/nio/cs/ext/Big5_Solaris.java
浏览文件 @
20f8f3ee
...
@@ -23,15 +23,14 @@
...
@@ -23,15 +23,14 @@
* have any questions.
* have any questions.
*/
*/
/*
*/
package
sun.nio.cs.ext
;
package
sun.nio.cs.ext
;
import
java.nio.charset.Charset
;
import
java.nio.charset.Charset
;
import
java.nio.charset.CharsetDecoder
;
import
java.nio.charset.CharsetDecoder
;
import
java.nio.charset.CharsetEncoder
;
import
java.nio.charset.CharsetEncoder
;
import
sun.nio.cs.HistoricallyNamedCharset
;
import
sun.nio.cs.HistoricallyNamedCharset
;
import
java.util.Arrays
;
import
static
sun
.
nio
.
cs
.
CharsetMapping
.*;
public
class
Big5_Solaris
extends
Charset
implements
HistoricallyNamedCharset
public
class
Big5_Solaris
extends
Charset
implements
HistoricallyNamedCharset
{
{
...
@@ -50,90 +49,78 @@ public class Big5_Solaris extends Charset implements HistoricallyNamedCharset
...
@@ -50,90 +49,78 @@ public class Big5_Solaris extends Charset implements HistoricallyNamedCharset
}
}
public
CharsetDecoder
newDecoder
()
{
public
CharsetDecoder
newDecoder
()
{
return
new
Decoder
(
this
);
initb2c
();
return
new
DoubleByte
.
Decoder
(
this
,
b2c
,
b2cSB
,
0x40
,
0xfe
);
}
}
public
CharsetEncoder
newEncoder
()
{
public
CharsetEncoder
newEncoder
()
{
return
new
Encoder
(
this
);
initc2b
();
return
new
DoubleByte
.
Encoder
(
this
,
c2b
,
c2bIndex
);
}
}
private
static
class
Decoder
extends
Big5
.
Decoder
{
static
char
[][]
b2c
;
static
char
[]
b2cSB
;
protected
char
decodeDouble
(
int
byte1
,
int
byte2
)
{
private
static
volatile
boolean
b2cInitialized
=
false
;
char
c
=
super
.
decodeDouble
(
byte1
,
byte2
);
static
void
initb2c
()
{
if
(
b2cInitialized
)
return
;
synchronized
(
Big5_Solaris
.
class
)
{
if
(
b2cInitialized
)
return
;
Big5
.
initb2c
();
b2c
=
Big5
.
b2c
.
clone
();
// Big5 Solaris implementation has 7 additional mappings
// Big5 Solaris implementation has 7 additional mappings
int
[]
sol
=
new
int
[]
{
if
(
c
==
REPLACE_CHAR
)
{
0xF9D6
,
0x7881
,
if
(
byte1
==
0xf9
)
{
0xF9D7
,
0x92B9
,
switch
(
byte2
)
{
0xF9D8
,
0x88CF
,
case
0xD6
:
0xF9D9
,
0x58BB
,
c
=
(
char
)
0x7881
;
0xF9DA
,
0x6052
,
break
;
0xF9DB
,
0x7CA7
,
case
0xD7
:
0xF9DC
,
0x5AFA
};
c
=
(
char
)
0x92B9
;
if
(
b2c
[
0xf9
]
==
DoubleByte
.
B2C_UNMAPPABLE
)
{
break
;
b2c
[
0xf9
]
=
new
char
[
0xfe
-
0x40
+
1
];
case
0xD8
:
Arrays
.
fill
(
b2c
[
0xf9
],
UNMAPPABLE_DECODING
);
c
=
(
char
)
0x88CF
;
break
;
case
0xD9
:
c
=
(
char
)
0x58BB
;
break
;
case
0xDA
:
c
=
(
char
)
0x6052
;
break
;
case
0xDB
:
c
=
(
char
)
0x7CA7
;
break
;
case
0xDC
:
c
=
(
char
)
0x5AFA
;
break
;
}
}
}
}
return
c
;
}
private
Decoder
(
Charset
cs
)
{
for
(
int
i
=
0
;
i
<
sol
.
length
;)
{
super
(
cs
);
b2c
[
0xf9
][
sol
[
i
++]
&
0xff
-
0x40
]
=
(
char
)
sol
[
i
++];
}
b2cSB
=
Big5
.
b2cSB
;
b2cInitialized
=
true
;
}
}
}
}
private
static
class
Encoder
extends
Big5
.
Encoder
{
static
char
[]
c2b
;
static
char
[]
c2bIndex
;
protected
int
encodeDouble
(
char
ch
)
{
private
static
volatile
boolean
c2bInitialized
=
false
;
int
r
=
super
.
encodeDouble
(
ch
);
static
void
initc2b
()
{
if
(
r
==
0
)
{
if
(
c2bInitialized
)
switch
(
ch
)
{
return
;
case
0x7881
:
synchronized
(
Big5_Solaris
.
class
)
{
r
=
0xF9D6
;
if
(
c2bInitialized
)
break
;
return
;
case
0x92B9
:
Big5
.
initc2b
();
r
=
0xF9D7
;
c2b
=
Big5
.
c2b
.
clone
();
break
;
c2bIndex
=
Big5
.
c2bIndex
.
clone
();
case
0x88CF
:
int
[]
sol
=
new
int
[]
{
r
=
0xF9D8
;
0x7881
,
0xF9D6
,
break
;
0x92B9
,
0xF9D7
,
case
0x58BB
:
0x88CF
,
0xF9D8
,
r
=
0xF9D9
;
0x58BB
,
0xF9D9
,
break
;
0x6052
,
0xF9DA
,
case
0x6052
:
0x7CA7
,
0xF9DB
,
r
=
0xF9DA
;
0x5AFA
,
0xF9DC
};
break
;
case
0x7CA7
:
for
(
int
i
=
0
;
i
<
sol
.
length
;)
{
r
=
0xF9DB
;
int
c
=
sol
[
i
++];
break
;
// no need to check c2bIndex[c >>8], we know it points
case
0x5AFA
:
// to the appropriate place.
r
=
0xF9DC
;
c2b
[
c2bIndex
[
c
>>
8
]
+
(
c
&
0xff
)]
=
(
char
)
sol
[
i
++];
break
;
}
}
c2bInitialized
=
true
;
}
return
r
;
}
private
Encoder
(
Charset
cs
)
{
super
(
cs
);
}
}
}
}
}
}
src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java
浏览文件 @
20f8f3ee
...
@@ -55,10 +55,15 @@ public class ExtendedCharsets
...
@@ -55,10 +55,15 @@ public class ExtendedCharsets
"csBig5"
"csBig5"
});
});
charset
(
"x-MS950-HKSCS-XP"
,
"MS950_HKSCS_XP"
,
new
String
[]
{
"MS950_HKSCS_XP"
// JDK historical;
});
charset
(
"x-MS950-HKSCS"
,
"MS950_HKSCS"
,
charset
(
"x-MS950-HKSCS"
,
"MS950_HKSCS"
,
new
String
[]
{
new
String
[]
{
// IANA aliases
// IANA aliases
"MS950_HKSCS"
// JDK historical;
"MS950_HKSCS"
// JDK historical;
});
});
charset
(
"x-windows-950"
,
"MS950"
,
charset
(
"x-windows-950"
,
"MS950"
,
...
@@ -86,8 +91,16 @@ public class ExtendedCharsets
...
@@ -86,8 +91,16 @@ public class ExtendedCharsets
"Big5_HKSCS"
,
// JDK historical
"Big5_HKSCS"
,
// JDK historical
"big5hk"
,
"big5hk"
,
"big5-hkscs"
,
"big5-hkscs"
,
"big5hkscs"
// Linux alias
});
charset
(
"x-Big5-HKSCS-2001"
,
"Big5_HKSCS_2001"
,
new
String
[]
{
"Big5_HKSCS_2001"
,
"big5hk-2001"
,
"big5-hkscs-2001"
,
"big5-hkscs:unicode3.0"
,
"big5-hkscs:unicode3.0"
,
"big5hkscs
"
// Linux alias
"big5hkscs
-2001"
,
});
});
charset
(
"x-Big5-Solaris"
,
"Big5_Solaris"
,
charset
(
"x-Big5-Solaris"
,
"Big5_Solaris"
,
...
...
src/share/classes/sun/nio/cs/ext/HKSCS.java
浏览文件 @
20f8f3ee
此差异已折叠。
点击以展开。
src/share/classes/sun/nio/cs/ext/HKSCS_2001.java
已删除
100644 → 0
浏览文件 @
4378eb62
此差异已折叠。
点击以展开。
src/share/classes/sun/nio/cs/ext/MS950_HKSCS.java
浏览文件 @
20f8f3ee
/*
/*
* Copyright 20
02-2004
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 20
10
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -55,47 +55,35 @@ public class MS950_HKSCS extends Charset implements HistoricallyNamedCharset
...
@@ -55,47 +55,35 @@ public class MS950_HKSCS extends Charset implements HistoricallyNamedCharset
return
new
Encoder
(
this
);
return
new
Encoder
(
this
);
}
}
private
static
class
Decoder
extends
HKSCS
.
Decoder
{
static
class
Decoder
extends
HKSCS
.
Decoder
{
private
static
DoubleByte
.
Decoder
ms950
=
private
static
DoubleByte
.
Decoder
ms950Dec
=
(
DoubleByte
.
Decoder
)
new
MS950
().
newDecoder
();
(
DoubleByte
.
Decoder
)
new
MS950
().
newDecoder
();
/*
private
static
char
[][]
b2cBmp
=
new
char
[
0x100
][];
* Note current decoder decodes 0x8BC2 --> U+F53A
private
static
char
[][]
b2cSupp
=
new
char
[
0x100
][];
* ie. maps to Unicode PUA.
static
{
* Unaccounted discrepancy between this mapping
initb2c
(
b2cBmp
,
HKSCSMapping
.
b2cBmpStr
);
* inferred from MS950/windows-950 and the published
initb2c
(
b2cSupp
,
HKSCSMapping
.
b2cSuppStr
);
* MS HKSCS mappings which maps 0x8BC2 --> U+5C22
* a character defined with the Unified CJK block
*/
protected
char
decodeDouble
(
int
byte1
,
int
byte2
)
{
char
c
=
super
.
decodeDouble
(
byte1
,
byte2
);
return
(
c
!=
UNMAPPABLE_DECODING
)
?
c
:
ms950Dec
.
decodeDouble
(
byte1
,
byte2
);
}
}
private
Decoder
(
Charset
cs
)
{
private
Decoder
(
Charset
cs
)
{
super
(
cs
);
super
(
cs
,
ms950
,
b2cBmp
,
b2cSupp
);
}
}
}
}
private
static
class
Encoder
extends
HKSCS
.
Encoder
{
private
static
class
Encoder
extends
HKSCS
.
Encoder
{
private
static
DoubleByte
.
Encoder
ms950
=
private
static
DoubleByte
.
Encoder
ms950Enc
=
(
DoubleByte
.
Encoder
)
new
MS950
().
newEncoder
();
(
DoubleByte
.
Encoder
)
new
MS950
().
newEncoder
();
/*
static
char
[][]
c2bBmp
=
new
char
[
0x100
][];
* Note current encoder encodes U+F53A --> 0x8BC2
static
char
[][]
c2bSupp
=
new
char
[
0x100
][];
* Published MS HKSCS mappings show
static
{
* U+5C22 <--> 0x8BC2
initc2b
(
c2bBmp
,
HKSCSMapping
.
b2cBmpStr
,
HKSCSMapping
.
pua
);
*/
initc2b
(
c2bSupp
,
HKSCSMapping
.
b2cSuppStr
,
null
);
protected
int
encodeDouble
(
char
ch
)
{
int
r
=
super
.
encodeDouble
(
ch
);
return
(
r
!=
UNMAPPABLE_ENCODING
)
?
r
:
ms950Enc
.
encodeChar
(
ch
);
}
}
private
Encoder
(
Charset
cs
)
{
private
Encoder
(
Charset
cs
)
{
super
(
cs
);
super
(
cs
,
ms950
,
c2bBmp
,
c2bSupp
);
}
}
}
}
}
}
src/share/classes/sun/
io/ByteToCharHKSCS_2001
.java
→
src/share/classes/sun/
nio/cs/ext/MS950_HKSCS_XP
.java
浏览文件 @
20f8f3ee
/*
/*
* Copyright 200
3-2007
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 200
2-2004
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -23,26 +23,80 @@
...
@@ -23,26 +23,80 @@
* have any questions.
* have any questions.
*/
*/
package
sun.
io
;
package
sun.
nio.cs.ext
;
import
sun.nio.cs.ext.HKSCS_2001
;
import
java.nio.charset.Charset
;
import
java.nio.charset.CharsetDecoder
;
import
java.nio.charset.CharsetEncoder
;
import
sun.nio.cs.HistoricallyNamedCharset
;
import
static
sun
.
nio
.
cs
.
CharsetMapping
.*;
/**
public
class
MS950_HKSCS_XP
extends
Charset
* Tables and data to convert HKSCS (2001 revision) to Unicode
{
*
public
MS950_HKSCS_XP
()
{
* @author ConverterGenerator tool
super
(
"x-MS950-HKSCS-XP"
,
ExtendedCharsets
.
aliasesFor
(
"x-MS950-HKSCS-XP"
));
*/
}
public
boolean
contains
(
Charset
cs
)
{
return
((
cs
.
name
().
equals
(
"US-ASCII"
))
||
(
cs
instanceof
MS950
)
||
(
cs
instanceof
MS950_HKSCS_XP
));
}
public
CharsetDecoder
newDecoder
()
{
return
new
Decoder
(
this
);
}
public
class
ByteToCharHKSCS_2001
extends
ByteToCharDoubleByte
{
public
CharsetEncoder
newEncoder
()
{
return
new
Encoder
(
this
);
}
static
class
Decoder
extends
HKSCS
.
Decoder
{
private
static
DoubleByte
.
Decoder
ms950
=
(
DoubleByte
.
Decoder
)
new
MS950
().
newDecoder
();
/*
* Note current decoder decodes 0x8BC2 --> U+F53A
* ie. maps to Unicode PUA.
* Unaccounted discrepancy between this mapping
* inferred from MS950/windows-950 and the published
* MS HKSCS mappings which maps 0x8BC2 --> U+5C22
* a character defined with the Unified CJK block
*/
private
static
char
[][]
b2cBmp
=
new
char
[
0x100
][];
static
{
initb2c
(
b2cBmp
,
HKSCS_XPMapping
.
b2cBmpStr
);
}
public
char
decodeDoubleEx
(
int
b1
,
int
b2
)
{
return
UNMAPPABLE_DECODING
;
}
public
String
getCharacterEncoding
()
{
private
Decoder
(
Charset
cs
)
{
return
"HKSCS_2001"
;
super
(
cs
,
ms950
,
b2cBmp
,
null
);
}
}
}
public
ByteToCharHKSCS_2001
()
{
private
static
class
Encoder
extends
HKSCS
.
Encoder
{
super
.
index1
=
HKSCS_2001
.
getDecoderIndex1
();
private
static
DoubleByte
.
Encoder
ms950
=
super
.
index2
=
HKSCS_2001
.
getDecoderIndex2
();
(
DoubleByte
.
Encoder
)
new
MS950
().
newEncoder
();
start
=
0x40
;
end
=
0xFE
;
/*
* Note current encoder encodes U+F53A --> 0x8BC2
* Published MS HKSCS mappings show
* U+5C22 <--> 0x8BC2
*/
static
char
[][]
c2bBmp
=
new
char
[
0x100
][];
static
{
initc2b
(
c2bBmp
,
HKSCS_XPMapping
.
b2cBmpStr
,
null
);
}
public
int
encodeSupp
(
int
cp
)
{
return
UNMAPPABLE_ENCODING
;
}
private
Encoder
(
Charset
cs
)
{
super
(
cs
,
ms950
,
c2bBmp
,
null
);
}
}
}
}
}
src/share/native/java/lang/System.c
浏览文件 @
20f8f3ee
...
@@ -67,10 +67,13 @@ Java_java_lang_System_identityHashCode(JNIEnv *env, jobject this, jobject x)
...
@@ -67,10 +67,13 @@ Java_java_lang_System_identityHashCode(JNIEnv *env, jobject this, jobject x)
(*env)->DeleteLocalRef(env, r); \
(*env)->DeleteLocalRef(env, r); \
} else ((void) 0)
} else ((void) 0)
#define PUTPROP_ForPlatformCString(props, key, val) \
/* "key" is a char type string with only ASCII character in it.
"val" is a nchar (typedefed in java_props.h) type string */
#define PUTPROP_ForPlatformNString(props, key, val) \
if (1) { \
if (1) { \
jstring jkey =
JNU_NewStringPlatform(env, key);
\
jstring jkey =
(*env)->NewStringUTF(env, key);
\
jstring jval =
JNU_New
StringPlatform(env, val); \
jstring jval =
Get
StringPlatform(env, val); \
jobject r = (*env)->CallObjectMethod(env, props, putID, jkey, jval); \
jobject r = (*env)->CallObjectMethod(env, props, putID, jkey, jval); \
if ((*env)->ExceptionOccurred(env)) return NULL; \
if ((*env)->ExceptionOccurred(env)) return NULL; \
(*env)->DeleteLocalRef(env, jkey); \
(*env)->DeleteLocalRef(env, jkey); \
...
@@ -150,7 +153,7 @@ Java_java_lang_System_initProperties(JNIEnv *env, jclass cla, jobject props)
...
@@ -150,7 +153,7 @@ Java_java_lang_System_initProperties(JNIEnv *env, jclass cla, jobject props)
(
sprops
->
cpu_isalist
?
sprops
->
cpu_isalist
:
""
));
(
sprops
->
cpu_isalist
?
sprops
->
cpu_isalist
:
""
));
PUTPROP
(
props
,
"sun.cpu.endian"
,
sprops
->
cpu_endian
);
PUTPROP
(
props
,
"sun.cpu.endian"
,
sprops
->
cpu_endian
);
/* !!! DO NOT call PUTPROP_ForPlatform
C
String before this line !!!
/* !!! DO NOT call PUTPROP_ForPlatform
N
String before this line !!!
* !!! I18n properties have not been set up yet !!!
* !!! I18n properties have not been set up yet !!!
*/
*/
...
@@ -195,18 +198,18 @@ Java_java_lang_System_initProperties(JNIEnv *env, jclass cla, jobject props)
...
@@ -195,18 +198,18 @@ Java_java_lang_System_initProperties(JNIEnv *env, jclass cla, jobject props)
*/
*/
PUTPROP
(
props
,
"java.awt.graphicsenv"
,
sprops
->
graphics_env
);
PUTPROP
(
props
,
"java.awt.graphicsenv"
,
sprops
->
graphics_env
);
if
(
sprops
->
font_dir
!=
NULL
)
{
if
(
sprops
->
font_dir
!=
NULL
)
{
PUTPROP_ForPlatform
C
String
(
props
,
PUTPROP_ForPlatform
N
String
(
props
,
"sun.java2d.fontpath"
,
sprops
->
font_dir
);
"sun.java2d.fontpath"
,
sprops
->
font_dir
);
}
}
PUTPROP_ForPlatform
C
String
(
props
,
"java.io.tmpdir"
,
sprops
->
tmp_dir
);
PUTPROP_ForPlatform
N
String
(
props
,
"java.io.tmpdir"
,
sprops
->
tmp_dir
);
PUTPROP_ForPlatform
C
String
(
props
,
"user.name"
,
sprops
->
user_name
);
PUTPROP_ForPlatform
N
String
(
props
,
"user.name"
,
sprops
->
user_name
);
PUTPROP_ForPlatform
C
String
(
props
,
"user.home"
,
sprops
->
user_home
);
PUTPROP_ForPlatform
N
String
(
props
,
"user.home"
,
sprops
->
user_home
);
PUTPROP
(
props
,
"user.timezone"
,
sprops
->
timezone
);
PUTPROP
(
props
,
"user.timezone"
,
sprops
->
timezone
);
PUTPROP_ForPlatform
C
String
(
props
,
"user.dir"
,
sprops
->
user_dir
);
PUTPROP_ForPlatform
N
String
(
props
,
"user.dir"
,
sprops
->
user_dir
);
/* This is a sun. property as it is currently only set for Gnome and
/* This is a sun. property as it is currently only set for Gnome and
* Windows desktops.
* Windows desktops.
...
...
src/share/native/java/lang/java_props.h
浏览文件 @
20f8f3ee
此差异已折叠。
点击以展开。
src/solaris/classes/sun/awt/fontconfigs/solaris.fontconfig.properties
浏览文件 @
20f8f3ee
...
@@ -352,7 +352,7 @@ sequence.allfonts=latin-1,dingbats,symbol
...
@@ -352,7 +352,7 @@ sequence.allfonts=latin-1,dingbats,symbol
sequence.allfonts.Big5
=
latin-1,chinese-big5,dingbats,symbol
sequence.allfonts.Big5
=
latin-1,chinese-big5,dingbats,symbol
sequence.allfonts.Big5-HKSCS
=
latin-1,chinese-big5,chinese-hkscs,dingbats,symbol
sequence.allfonts.Big5-HKSCS
-2001
=
latin-1,chinese-big5,chinese-hkscs,dingbats,symbol
sequence.allfonts.windows-1251
=
cyrillic-cp1251,latin-1,dingbats,symbol
sequence.allfonts.windows-1251
=
cyrillic-cp1251,latin-1,dingbats,symbol
...
...
src/solaris/native/java/lang/java_props_md.c
浏览文件 @
20f8f3ee
此差异已折叠。
点击以展开。
src/windows/classes/sun/awt/windows/fontconfig.properties
浏览文件 @
20f8f3ee
此差异已折叠。
点击以展开。
src/windows/native/java/lang/ProcessImpl_md.c
浏览文件 @
20f8f3ee
此差异已折叠。
点击以展开。
src/windows/native/java/lang/java_props_md.c
浏览文件 @
20f8f3ee
此差异已折叠。
点击以展开。
test/java/lang/ProcessBuilder/Basic.java
浏览文件 @
20f8f3ee
此差异已折叠。
点击以展开。
test/java/nio/charset/Charset/NIOCharsetAvailabilityTest.java
浏览文件 @
20f8f3ee
此差异已折叠。
点击以展开。
test/java/nio/charset/Charset/RegisteredCharsets.java
浏览文件 @
20f8f3ee
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录