6653797: Reimplement JDK charset repository charsets.jar

Migrated all jis based charsets to new implementation

Reviewed-by: okutsu
This commit is contained in:
Xueming Shen 2012-07-24 12:17:39 -07:00
parent 58aa6e97a4
commit b9fa2e4fb9
71 changed files with 59816 additions and 11762 deletions

View File

@ -221,8 +221,6 @@ FILES_src = \
sun/nio/cs/HistoricallyNamedCharset.java \
sun/nio/cs/ISO_8859_1.java \
sun/nio/cs/SingleByte.java \
sun/nio/cs/SingleByteDecoder.java \
sun/nio/cs/SingleByteEncoder.java \
sun/nio/cs/StreamEncoder.java \
sun/nio/cs/StreamDecoder.java \
sun/nio/cs/Surrogate.java \

View File

@ -34,8 +34,6 @@ FILES_java = \
sun/nio/cs/HistoricallyNamedCharset.java \
sun/nio/cs/Surrogate.java \
sun/nio/cs/CharsetMapping.java \
sun/nio/cs/SingleByteEncoder.java \
sun/nio/cs/SingleByteDecoder.java \
sun/nio/cs/UnicodeEncoder.java \
sun/nio/cs/UnicodeDecoder.java \
sun/nio/cs/ISO_8859_1.java \

View File

@ -127,7 +127,17 @@ FILES_gen_extcs = \
sun/nio/cs/ext/MS949.java \
sun/nio/cs/ext/MS950.java \
sun/nio/cs/ext/GBK.java \
sun/nio/cs/ext/Big5.java
sun/nio/cs/ext/Big5.java \
sun/nio/cs/ext/SJIS.java \
sun/nio/cs/ext/PCK.java \
sun/nio/cs/ext/JIS_X_0201.java \
sun/nio/cs/ext/JIS_X_0208.java \
sun/nio/cs/ext/JIS_X_0208_MS5022X.java \
sun/nio/cs/ext/JIS_X_0208_MS932.java \
sun/nio/cs/ext/JIS_X_0208_Solaris.java \
sun/nio/cs/ext/JIS_X_0212.java \
sun/nio/cs/ext/JIS_X_0212_MS5022X.java \
sun/nio/cs/ext/JIS_X_0212_Solaris.java
FILES_java = $(FILES_src) $(FILES_gen_extcs)

View File

@ -54,7 +54,7 @@ public class $NAME_CLZ$ extends Charset
public CharsetEncoder newEncoder() {
initc2b();
return new DoubleByte.Encoder$ENCTYPE$(this, c2b, c2bIndex);
return new DoubleByte.Encoder$ENCTYPE$(this, $ENC_REPLACEMENT$ c2b, c2bIndex);
}
$B2C$

View File

@ -0,0 +1,2 @@
0x7e 0x203e
0x5c 0x00a5

View File

@ -1,257 +1,192 @@
#Generated from JIS_X_0201.java
0x00 U+0000
0x01 U+0001
0x02 U+0002
0x03 U+0003
0x04 U+0004
0x05 U+0005
0x06 U+0006
0x07 U+0007
0x08 U+0008
0x09 U+0009
0x0a U+000a
0x0b U+000b
0x0c U+000c
0x0d U+000d
0x0e U+000e
0x0f U+000f
0x10 U+0010
0x11 U+0011
0x12 U+0012
0x13 U+0013
0x14 U+0014
0x15 U+0015
0x16 U+0016
0x17 U+0017
0x18 U+0018
0x19 U+0019
0x1a U+001a
0x1b U+001b
0x1c U+001c
0x1d U+001d
0x1e U+001e
0x1f U+001f
0x20 U+0020
0x21 U+0021
0x22 U+0022
0x23 U+0023
0x24 U+0024
0x25 U+0025
0x26 U+0026
0x27 U+0027
0x28 U+0028
0x29 U+0029
0x2a U+002a
0x2b U+002b
0x2c U+002c
0x2d U+002d
0x2e U+002e
0x2f U+002f
0x30 U+0030
0x31 U+0031
0x32 U+0032
0x33 U+0033
0x34 U+0034
0x35 U+0035
0x36 U+0036
0x37 U+0037
0x38 U+0038
0x39 U+0039
0x3a U+003a
0x3b U+003b
0x3c U+003c
0x3d U+003d
0x3e U+003e
0x3f U+003f
0x40 U+0040
0x41 U+0041
0x42 U+0042
0x43 U+0043
0x44 U+0044
0x45 U+0045
0x46 U+0046
0x47 U+0047
0x48 U+0048
0x49 U+0049
0x4a U+004a
0x4b U+004b
0x4c U+004c
0x4d U+004d
0x4e U+004e
0x4f U+004f
0x50 U+0050
0x51 U+0051
0x52 U+0052
0x53 U+0053
0x54 U+0054
0x55 U+0055
0x56 U+0056
0x57 U+0057
0x58 U+0058
0x59 U+0059
0x5a U+005a
0x5b U+005b
0x5c U+005c
0x5d U+005d
0x5e U+005e
0x5f U+005f
0x60 U+0060
0x61 U+0061
0x62 U+0062
0x63 U+0063
0x64 U+0064
0x65 U+0065
0x66 U+0066
0x67 U+0067
0x68 U+0068
0x69 U+0069
0x6a U+006a
0x6b U+006b
0x6c U+006c
0x6d U+006d
0x6e U+006e
0x6f U+006f
0x70 U+0070
0x71 U+0071
0x72 U+0072
0x73 U+0073
0x74 U+0074
0x75 U+0075
0x76 U+0076
0x77 U+0077
0x78 U+0078
0x79 U+0079
0x7a U+007a
0x7b U+007b
0x7c U+007c
0x7d U+007d
0x7e U+007e
0x7f U+007f
0x80 U+fffd
0x81 U+fffd
0x82 U+fffd
0x83 U+fffd
0x84 U+fffd
0x85 U+fffd
0x86 U+fffd
0x87 U+fffd
0x88 U+fffd
0x89 U+fffd
0x8a U+fffd
0x8b U+fffd
0x8c U+fffd
0x8d U+fffd
0x8e U+fffd
0x8f U+fffd
0x90 U+fffd
0x91 U+fffd
0x92 U+fffd
0x93 U+fffd
0x94 U+fffd
0x95 U+fffd
0x96 U+fffd
0x97 U+fffd
0x98 U+fffd
0x99 U+fffd
0x9a U+fffd
0x9b U+fffd
0x9c U+fffd
0x9d U+fffd
0x9e U+fffd
0x9f U+fffd
0xa0 U+fffd
0xa1 U+ff61
0xa2 U+ff62
0xa3 U+ff63
0xa4 U+ff64
0xa5 U+ff65
0xa6 U+ff66
0xa7 U+ff67
0xa8 U+ff68
0xa9 U+ff69
0xaa U+ff6a
0xab U+ff6b
0xac U+ff6c
0xad U+ff6d
0xae U+ff6e
0xaf U+ff6f
0xb0 U+ff70
0xb1 U+ff71
0xb2 U+ff72
0xb3 U+ff73
0xb4 U+ff74
0xb5 U+ff75
0xb6 U+ff76
0xb7 U+ff77
0xb8 U+ff78
0xb9 U+ff79
0xba U+ff7a
0xbb U+ff7b
0xbc U+ff7c
0xbd U+ff7d
0xbe U+ff7e
0xbf U+ff7f
0xc0 U+ff80
0xc1 U+ff81
0xc2 U+ff82
0xc3 U+ff83
0xc4 U+ff84
0xc5 U+ff85
0xc6 U+ff86
0xc7 U+ff87
0xc8 U+ff88
0xc9 U+ff89
0xca U+ff8a
0xcb U+ff8b
0xcc U+ff8c
0xcd U+ff8d
0xce U+ff8e
0xcf U+ff8f
0xd0 U+ff90
0xd1 U+ff91
0xd2 U+ff92
0xd3 U+ff93
0xd4 U+ff94
0xd5 U+ff95
0xd6 U+ff96
0xd7 U+ff97
0xd8 U+ff98
0xd9 U+ff99
0xda U+ff9a
0xdb U+ff9b
0xdc U+ff9c
0xdd U+ff9d
0xde U+ff9e
0xdf U+ff9f
0xe0 U+fffd
0xe1 U+fffd
0xe2 U+fffd
0xe3 U+fffd
0xe4 U+fffd
0xe5 U+fffd
0xe6 U+fffd
0xe7 U+fffd
0xe8 U+fffd
0xe9 U+fffd
0xea U+fffd
0xeb U+fffd
0xec U+fffd
0xed U+fffd
0xee U+fffd
0xef U+fffd
0xf0 U+fffd
0xf1 U+fffd
0xf2 U+fffd
0xf3 U+fffd
0xf4 U+fffd
0xf5 U+fffd
0xf6 U+fffd
0xf7 U+fffd
0xf8 U+fffd
0xf9 U+fffd
0xfa U+fffd
0xfb U+fffd
0xfc U+fffd
0xfd U+fffd
0xfe U+fffd
0xff U+fffd
# copy/pasted from JIS_X_0201.b2c + code points 0-0x1f and 0x7f
0x00 0x0000
0x01 0x0001
0x02 0x0002
0x03 0x0003
0x04 0x0004
0x05 0x0005
0x06 0x0006
0x07 0x0007
0x08 0x0008
0x09 0x0009
0x0A 0x000A
0x0B 0x000B
0x0C 0x000C
0x0D 0x000D
0x0E 0x000E
0x0F 0x000F
0x10 0x0010
0x11 0x0011
0x12 0x0012
0x13 0x0013
0x14 0x0014
0x15 0x0015
0x16 0x0016
0x17 0x0017
0x18 0x0018
0x19 0x0019
0x1A 0x001A
0x1B 0x001B
0x1C 0x001C
0x1D 0x001D
0x1E 0x001E
0x1F 0x001F
0x20 0x0020 # SPACE
0x21 0x0021 # EXCLAMATION MARK
0x22 0x0022 # QUOTATION MARK
0x23 0x0023 # NUMBER SIGN
0x24 0x0024 # DOLLAR SIGN
0x25 0x0025 # PERCENT SIGN
0x26 0x0026 # AMPERSAND
0x27 0x0027 # APOSTROPHE
0x28 0x0028 # LEFT PARENTHESIS
0x29 0x0029 # RIGHT PARENTHESIS
0x2A 0x002A # ASTERISK
0x2B 0x002B # PLUS SIGN
0x2C 0x002C # COMMA
0x2D 0x002D # HYPHEN-MINUS
0x2E 0x002E # FULL STOP
0x2F 0x002F # SOLIDUS
0x30 0x0030 # DIGIT ZERO
0x31 0x0031 # DIGIT ONE
0x32 0x0032 # DIGIT TWO
0x33 0x0033 # DIGIT THREE
0x34 0x0034 # DIGIT FOUR
0x35 0x0035 # DIGIT FIVE
0x36 0x0036 # DIGIT SIX
0x37 0x0037 # DIGIT SEVEN
0x38 0x0038 # DIGIT EIGHT
0x39 0x0039 # DIGIT NINE
0x3A 0x003A # COLON
0x3B 0x003B # SEMICOLON
0x3C 0x003C # LESS-THAN SIGN
0x3D 0x003D # EQUALS SIGN
0x3E 0x003E # GREATER-THAN SIGN
0x3F 0x003F # QUESTION MARK
0x40 0x0040 # COMMERCIAL AT
0x41 0x0041 # LATIN CAPITAL LETTER A
0x42 0x0042 # LATIN CAPITAL LETTER B
0x43 0x0043 # LATIN CAPITAL LETTER C
0x44 0x0044 # LATIN CAPITAL LETTER D
0x45 0x0045 # LATIN CAPITAL LETTER E
0x46 0x0046 # LATIN CAPITAL LETTER F
0x47 0x0047 # LATIN CAPITAL LETTER G
0x48 0x0048 # LATIN CAPITAL LETTER H
0x49 0x0049 # LATIN CAPITAL LETTER I
0x4A 0x004A # LATIN CAPITAL LETTER J
0x4B 0x004B # LATIN CAPITAL LETTER K
0x4C 0x004C # LATIN CAPITAL LETTER L
0x4D 0x004D # LATIN CAPITAL LETTER M
0x4E 0x004E # LATIN CAPITAL LETTER N
0x4F 0x004F # LATIN CAPITAL LETTER O
0x50 0x0050 # LATIN CAPITAL LETTER P
0x51 0x0051 # LATIN CAPITAL LETTER Q
0x52 0x0052 # LATIN CAPITAL LETTER R
0x53 0x0053 # LATIN CAPITAL LETTER S
0x54 0x0054 # LATIN CAPITAL LETTER T
0x55 0x0055 # LATIN CAPITAL LETTER U
0x56 0x0056 # LATIN CAPITAL LETTER V
0x57 0x0057 # LATIN CAPITAL LETTER W
0x58 0x0058 # LATIN CAPITAL LETTER X
0x59 0x0059 # LATIN CAPITAL LETTER Y
0x5A 0x005A # LATIN CAPITAL LETTER Z
0x5B 0x005B # LEFT SQUARE BRACKET
0x5C 0x005C # YEN SIGN
0x5D 0x005D # RIGHT SQUARE BRACKET
0x5E 0x005E # CIRCUMFLEX ACCENT
0x5F 0x005F # LOW LINE
0x60 0x0060 # GRAVE ACCENT
0x61 0x0061 # LATIN SMALL LETTER A
0x62 0x0062 # LATIN SMALL LETTER B
0x63 0x0063 # LATIN SMALL LETTER C
0x64 0x0064 # LATIN SMALL LETTER D
0x65 0x0065 # LATIN SMALL LETTER E
0x66 0x0066 # LATIN SMALL LETTER F
0x67 0x0067 # LATIN SMALL LETTER G
0x68 0x0068 # LATIN SMALL LETTER H
0x69 0x0069 # LATIN SMALL LETTER I
0x6A 0x006A # LATIN SMALL LETTER J
0x6B 0x006B # LATIN SMALL LETTER K
0x6C 0x006C # LATIN SMALL LETTER L
0x6D 0x006D # LATIN SMALL LETTER M
0x6E 0x006E # LATIN SMALL LETTER N
0x6F 0x006F # LATIN SMALL LETTER O
0x70 0x0070 # LATIN SMALL LETTER P
0x71 0x0071 # LATIN SMALL LETTER Q
0x72 0x0072 # LATIN SMALL LETTER R
0x73 0x0073 # LATIN SMALL LETTER S
0x74 0x0074 # LATIN SMALL LETTER T
0x75 0x0075 # LATIN SMALL LETTER U
0x76 0x0076 # LATIN SMALL LETTER V
0x77 0x0077 # LATIN SMALL LETTER W
0x78 0x0078 # LATIN SMALL LETTER X
0x79 0x0079 # LATIN SMALL LETTER Y
0x7A 0x007A # LATIN SMALL LETTER Z
0x7B 0x007B # LEFT CURLY BRACKET
0x7C 0x007C # VERTICAL LINE
0x7D 0x007D # RIGHT CURLY BRACKET
0x7E 0x007E # OVERLINE
0x7F 0x007F
0xA1 0xFF61 # HALFWIDTH IDEOGRAPHIC FULL STOP
0xA2 0xFF62 # HALFWIDTH LEFT CORNER BRACKET
0xA3 0xFF63 # HALFWIDTH RIGHT CORNER BRACKET
0xA4 0xFF64 # HALFWIDTH IDEOGRAPHIC COMMA
0xA5 0xFF65 # HALFWIDTH KATAKANA MIDDLE DOT
0xA6 0xFF66 # HALFWIDTH KATAKANA LETTER WO
0xA7 0xFF67 # HALFWIDTH KATAKANA LETTER SMALL A
0xA8 0xFF68 # HALFWIDTH KATAKANA LETTER SMALL I
0xA9 0xFF69 # HALFWIDTH KATAKANA LETTER SMALL U
0xAA 0xFF6A # HALFWIDTH KATAKANA LETTER SMALL E
0xAB 0xFF6B # HALFWIDTH KATAKANA LETTER SMALL O
0xAC 0xFF6C # HALFWIDTH KATAKANA LETTER SMALL YA
0xAD 0xFF6D # HALFWIDTH KATAKANA LETTER SMALL YU
0xAE 0xFF6E # HALFWIDTH KATAKANA LETTER SMALL YO
0xAF 0xFF6F # HALFWIDTH KATAKANA LETTER SMALL TU
0xB0 0xFF70 # HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK
0xB1 0xFF71 # HALFWIDTH KATAKANA LETTER A
0xB2 0xFF72 # HALFWIDTH KATAKANA LETTER I
0xB3 0xFF73 # HALFWIDTH KATAKANA LETTER U
0xB4 0xFF74 # HALFWIDTH KATAKANA LETTER E
0xB5 0xFF75 # HALFWIDTH KATAKANA LETTER O
0xB6 0xFF76 # HALFWIDTH KATAKANA LETTER KA
0xB7 0xFF77 # HALFWIDTH KATAKANA LETTER KI
0xB8 0xFF78 # HALFWIDTH KATAKANA LETTER KU
0xB9 0xFF79 # HALFWIDTH KATAKANA LETTER KE
0xBA 0xFF7A # HALFWIDTH KATAKANA LETTER KO
0xBB 0xFF7B # HALFWIDTH KATAKANA LETTER SA
0xBC 0xFF7C # HALFWIDTH KATAKANA LETTER SI
0xBD 0xFF7D # HALFWIDTH KATAKANA LETTER SU
0xBE 0xFF7E # HALFWIDTH KATAKANA LETTER SE
0xBF 0xFF7F # HALFWIDTH KATAKANA LETTER SO
0xC0 0xFF80 # HALFWIDTH KATAKANA LETTER TA
0xC1 0xFF81 # HALFWIDTH KATAKANA LETTER TI
0xC2 0xFF82 # HALFWIDTH KATAKANA LETTER TU
0xC3 0xFF83 # HALFWIDTH KATAKANA LETTER TE
0xC4 0xFF84 # HALFWIDTH KATAKANA LETTER TO
0xC5 0xFF85 # HALFWIDTH KATAKANA LETTER NA
0xC6 0xFF86 # HALFWIDTH KATAKANA LETTER NI
0xC7 0xFF87 # HALFWIDTH KATAKANA LETTER NU
0xC8 0xFF88 # HALFWIDTH KATAKANA LETTER NE
0xC9 0xFF89 # HALFWIDTH KATAKANA LETTER NO
0xCA 0xFF8A # HALFWIDTH KATAKANA LETTER HA
0xCB 0xFF8B # HALFWIDTH KATAKANA LETTER HI
0xCC 0xFF8C # HALFWIDTH KATAKANA LETTER HU
0xCD 0xFF8D # HALFWIDTH KATAKANA LETTER HE
0xCE 0xFF8E # HALFWIDTH KATAKANA LETTER HO
0xCF 0xFF8F # HALFWIDTH KATAKANA LETTER MA
0xD0 0xFF90 # HALFWIDTH KATAKANA LETTER MI
0xD1 0xFF91 # HALFWIDTH KATAKANA LETTER MU
0xD2 0xFF92 # HALFWIDTH KATAKANA LETTER ME
0xD3 0xFF93 # HALFWIDTH KATAKANA LETTER MO
0xD4 0xFF94 # HALFWIDTH KATAKANA LETTER YA
0xD5 0xFF95 # HALFWIDTH KATAKANA LETTER YU
0xD6 0xFF96 # HALFWIDTH KATAKANA LETTER YO
0xD7 0xFF97 # HALFWIDTH KATAKANA LETTER RA
0xD8 0xFF98 # HALFWIDTH KATAKANA LETTER RI
0xD9 0xFF99 # HALFWIDTH KATAKANA LETTER RU
0xDA 0xFF9A # HALFWIDTH KATAKANA LETTER RE
0xDB 0xFF9B # HALFWIDTH KATAKANA LETTER RO
0xDC 0xFF9C # HALFWIDTH KATAKANA LETTER WA
0xDD 0xFF9D # HALFWIDTH KATAKANA LETTER N
0xDE 0xFF9E # HALFWIDTH KATAKANA VOICED SOUND MARK
0xDF 0xFF9F # HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,73 @@
#
# The diff of JIS_X_0208_MS5022X_Decoder and
# JIS_X_0208_MS5022X_Encoder
#
0x215d 0xff0d
0x2142 0x2225
0x2123 0xff61
0x2156 0xff62
0x2157 0xff63
0x2122 0xff64
0x2126 0xff65
0x2572 0xff66
0x2521 0xff67
0x2523 0xff68
0x2525 0xff69
0x2527 0xff6a
0x2529 0xff6b
0x2563 0xff6c
0x2565 0xff6d
0x2567 0xff6e
0x2543 0xff6f
0x213c 0xff70
0x2522 0xff71
0x2524 0xff72
0x2526 0xff73
0x2528 0xff74
0x252a 0xff75
0x252b 0xff76
0x252d 0xff77
0x252f 0xff78
0x2531 0xff79
0x2533 0xff7a
0x2535 0xff7b
0x2537 0xff7c
0x2539 0xff7d
0x253b 0xff7e
0x253d 0xff7f
0x253f 0xff80
0x2541 0xff81
0x2544 0xff82
0x2546 0xff83
0x2548 0xff84
0x254a 0xff85
0x254b 0xff86
0x254c 0xff87
0x254d 0xff88
0x254e 0xff89
0x254f 0xff8a
0x2552 0xff8b
0x2555 0xff8c
0x2558 0xff8d
0x255b 0xff8e
0x255e 0xff8f
0x255f 0xff90
0x2560 0xff91
0x2561 0xff92
0x2562 0xff93
0x2564 0xff94
0x2566 0xff95
0x2568 0xff96
0x2569 0xff97
0x256a 0xff98
0x256b 0xff99
0x256c 0xff9a
0x256d 0xff9b
0x256f 0xff9c
0x2573 0xff9d
0x212b 0xff9e
0x212c 0xff9f
0x2171 0xffe0
0x2172 0xffe1
0x224c 0xffe2

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,10 @@
0x224c 0xffe2
0x225d 0x22a5
0x2265 0x221a
0x2269 0x222b
0x2d70 0x2252
0x2d71 0x2261
0x2d77 0x2220
0x2d7a 0x2235
0x2d7b 0x2229
0x2d7c 0x222a

View File

@ -0,0 +1,851 @@
#
# Generated from JIS_X_0208_De/Encoder
#
# added 0x2129 entry, which is the "replacement" for 0208
0x2129 0xff1f
#
0x2d21 0x2460
0x2d22 0x2461
0x2d23 0x2462
0x2d24 0x2463
0x2d25 0x2464
0x2d26 0x2465
0x2d27 0x2466
0x2d28 0x2467
0x2d29 0x2468
0x2d2a 0x2469
0x2d2b 0x246a
0x2d2c 0x246b
0x2d2d 0x246c
0x2d2e 0x246d
0x2d2f 0x246e
0x2d30 0x246f
0x2d31 0x2470
0x2d32 0x2471
0x2d33 0x2472
0x2d34 0x2473
0x2d35 0x2160
0x2d36 0x2161
0x2d37 0x2162
0x2d38 0x2163
0x2d39 0x2164
0x2d3a 0x2165
0x2d3b 0x2166
0x2d3c 0x2167
0x2d3d 0x2168
0x2d3e 0x2169
0x2d40 0x3349
0x2d41 0x3314
0x2d42 0x3322
0x2d43 0x334d
0x2d44 0x3318
0x2d45 0x3327
0x2d46 0x3303
0x2d47 0x3336
0x2d48 0x3351
0x2d49 0x3357
0x2d4a 0x330d
0x2d4b 0x3326
0x2d4c 0x3323
0x2d4d 0x332b
0x2d4e 0x334a
0x2d4f 0x333b
0x2d50 0x339c
0x2d51 0x339d
0x2d52 0x339e
0x2d53 0x338e
0x2d54 0x338f
0x2d55 0x33c4
0x2d56 0x33a1
0x2d5f 0x337b
0x2d60 0x301d
0x2d61 0x301f
0x2d62 0x2116
0x2d63 0x33cd
0x2d64 0x2121
0x2d65 0x32a4
0x2d66 0x32a5
0x2d67 0x32a6
0x2d68 0x32a7
0x2d69 0x32a8
0x2d6a 0x3231
0x2d6b 0x3232
0x2d6c 0x3239
0x2d6d 0x337e
0x2d6e 0x337d
0x2d6f 0x337c
0x2d70 0x2252
0x2d71 0x2261
0x2d72 0x222b
0x2d73 0x222e
0x2d74 0x2211
0x2d75 0x221a
0x2d76 0x22a5
0x2d77 0x2220
0x2d78 0x221f
0x2d79 0x22bf
0x2d7a 0x2235
0x2d7b 0x2229
0x2d7c 0x222a
0x7921 0x7e8a
0x7922 0x891c
0x7923 0x9348
0x7924 0x9288
0x7925 0x84dc
0x7926 0x4fc9
0x7927 0x70bb
0x7928 0x6631
0x7929 0x68c8
0x792a 0x92f9
0x792b 0x66fb
0x792c 0x5f45
0x792d 0x4e28
0x792e 0x4ee1
0x792f 0x4efc
0x7930 0x4f00
0x7931 0x4f03
0x7932 0x4f39
0x7933 0x4f56
0x7934 0x4f92
0x7935 0x4f8a
0x7936 0x4f9a
0x7937 0x4f94
0x7938 0x4fcd
0x7939 0x5040
0x793a 0x5022
0x793b 0x4fff
0x793c 0x501e
0x793d 0x5046
0x793e 0x5070
0x793f 0x5042
0x7940 0x5094
0x7941 0x50f4
0x7942 0x50d8
0x7943 0x514a
0x7944 0x5164
0x7945 0x519d
0x7946 0x51be
0x7947 0x51ec
0x7948 0x5215
0x7949 0x529c
0x794a 0x52a6
0x794b 0x52c0
0x794c 0x52db
0x794d 0x5300
0x794e 0x5307
0x794f 0x5324
0x7950 0x5372
0x7951 0x5393
0x7952 0x53b2
0x7953 0x53dd
0x7954 0xfa0e
0x7955 0x549c
0x7956 0x548a
0x7957 0x54a9
0x7958 0x54ff
0x7959 0x5586
0x795a 0x5759
0x795b 0x5765
0x795c 0x57ac
0x795d 0x57c8
0x795e 0x57c7
0x795f 0xfa0f
0x7960 0xfa10
0x7961 0x589e
0x7962 0x58b2
0x7963 0x590b
0x7964 0x5953
0x7965 0x595b
0x7966 0x595d
0x7967 0x5963
0x7968 0x59a4
0x7969 0x59ba
0x796a 0x5b56
0x796b 0x5bc0
0x796c 0x752f
0x796d 0x5bd8
0x796e 0x5bec
0x796f 0x5c1e
0x7970 0x5ca6
0x7971 0x5cba
0x7972 0x5cf5
0x7973 0x5d27
0x7974 0x5d53
0x7975 0xfa11
0x7976 0x5d42
0x7977 0x5d6d
0x7978 0x5db8
0x7979 0x5db9
0x797a 0x5dd0
0x797b 0x5f21
0x797c 0x5f34
0x797d 0x5f67
0x797e 0x5fb7
0x7a21 0x5fde
0x7a22 0x605d
0x7a23 0x6085
0x7a24 0x608a
0x7a25 0x60de
0x7a26 0x60d5
0x7a27 0x6120
0x7a28 0x60f2
0x7a29 0x6111
0x7a2a 0x6137
0x7a2b 0x6130
0x7a2c 0x6198
0x7a2d 0x6213
0x7a2e 0x62a6
0x7a2f 0x63f5
0x7a30 0x6460
0x7a31 0x649d
0x7a32 0x64ce
0x7a33 0x654e
0x7a34 0x6600
0x7a35 0x6615
0x7a36 0x663b
0x7a37 0x6609
0x7a38 0x662e
0x7a39 0x661e
0x7a3a 0x6624
0x7a3b 0x6665
0x7a3c 0x6657
0x7a3d 0x6659
0x7a3e 0xfa12
0x7a3f 0x6673
0x7a40 0x6699
0x7a41 0x66a0
0x7a42 0x66b2
0x7a43 0x66bf
0x7a44 0x66fa
0x7a45 0x670e
0x7a46 0xf929
0x7a47 0x6766
0x7a48 0x67bb
0x7a49 0x6852
0x7a4a 0x67c0
0x7a4b 0x6801
0x7a4c 0x6844
0x7a4d 0x68cf
0x7a4e 0xfa13
0x7a4f 0x6968
0x7a50 0xfa14
0x7a51 0x6998
0x7a52 0x69e2
0x7a53 0x6a30
0x7a54 0x6a6b
0x7a55 0x6a46
0x7a56 0x6a73
0x7a57 0x6a7e
0x7a58 0x6ae2
0x7a59 0x6ae4
0x7a5a 0x6bd6
0x7a5b 0x6c3f
0x7a5c 0x6c5c
0x7a5d 0x6c86
0x7a5e 0x6c6f
0x7a5f 0x6cda
0x7a60 0x6d04
0x7a61 0x6d87
0x7a62 0x6d6f
0x7a63 0x6d96
0x7a64 0x6dac
0x7a65 0x6dcf
0x7a66 0x6df8
0x7a67 0x6df2
0x7a68 0x6dfc
0x7a69 0x6e39
0x7a6a 0x6e5c
0x7a6b 0x6e27
0x7a6c 0x6e3c
0x7a6d 0x6ebf
0x7a6e 0x6f88
0x7a6f 0x6fb5
0x7a70 0x6ff5
0x7a71 0x7005
0x7a72 0x7007
0x7a73 0x7028
0x7a74 0x7085
0x7a75 0x70ab
0x7a76 0x710f
0x7a77 0x7104
0x7a78 0x715c
0x7a79 0x7146
0x7a7a 0x7147
0x7a7b 0xfa15
0x7a7c 0x71c1
0x7a7d 0x71fe
0x7a7e 0x72b1
0x7b21 0x72be
0x7b22 0x7324
0x7b23 0xfa16
0x7b24 0x7377
0x7b25 0x73bd
0x7b26 0x73c9
0x7b27 0x73d6
0x7b28 0x73e3
0x7b29 0x73d2
0x7b2a 0x7407
0x7b2b 0x73f5
0x7b2c 0x7426
0x7b2d 0x742a
0x7b2e 0x7429
0x7b2f 0x742e
0x7b30 0x7462
0x7b31 0x7489
0x7b32 0x749f
0x7b33 0x7501
0x7b34 0x756f
0x7b35 0x7682
0x7b36 0x769c
0x7b37 0x769e
0x7b38 0x769b
0x7b39 0x76a6
0x7b3a 0xfa17
0x7b3b 0x7746
0x7b3c 0x52af
0x7b3d 0x7821
0x7b3e 0x784e
0x7b3f 0x7864
0x7b40 0x787a
0x7b41 0x7930
0x7b42 0xfa18
0x7b43 0xfa19
0x7b44 0xfa1a
0x7b45 0x7994
0x7b46 0xfa1b
0x7b47 0x799b
0x7b48 0x7ad1
0x7b49 0x7ae7
0x7b4a 0xfa1c
0x7b4b 0x7aeb
0x7b4c 0x7b9e
0x7b4d 0xfa1d
0x7b4e 0x7d48
0x7b4f 0x7d5c
0x7b50 0x7db7
0x7b51 0x7da0
0x7b52 0x7dd6
0x7b53 0x7e52
0x7b54 0x7f47
0x7b55 0x7fa1
0x7b56 0xfa1e
0x7b57 0x8301
0x7b58 0x8362
0x7b59 0x837f
0x7b5a 0x83c7
0x7b5b 0x83f6
0x7b5c 0x8448
0x7b5d 0x84b4
0x7b5e 0x8553
0x7b5f 0x8559
0x7b60 0x856b
0x7b61 0xfa1f
0x7b62 0x85b0
0x7b63 0xfa20
0x7b64 0xfa21
0x7b65 0x8807
0x7b66 0x88f5
0x7b67 0x8a12
0x7b68 0x8a37
0x7b69 0x8a79
0x7b6a 0x8aa7
0x7b6b 0x8abe
0x7b6c 0x8adf
0x7b6d 0xfa22
0x7b6e 0x8af6
0x7b6f 0x8b53
0x7b70 0x8b7f
0x7b71 0x8cf0
0x7b72 0x8cf4
0x7b73 0x8d12
0x7b74 0x8d76
0x7b75 0xfa23
0x7b76 0x8ecf
0x7b77 0xfa24
0x7b78 0xfa25
0x7b79 0x9067
0x7b7a 0x90de
0x7b7b 0xfa26
0x7b7c 0x9115
0x7b7d 0x9127
0x7b7e 0x91da
0x7c21 0x91d7
0x7c22 0x91de
0x7c23 0x91ed
0x7c24 0x91ee
0x7c25 0x91e4
0x7c26 0x91e5
0x7c27 0x9206
0x7c28 0x9210
0x7c29 0x920a
0x7c2a 0x923a
0x7c2b 0x9240
0x7c2c 0x923c
0x7c2d 0x924e
0x7c2e 0x9259
0x7c2f 0x9251
0x7c30 0x9239
0x7c31 0x9267
0x7c32 0x92a7
0x7c33 0x9277
0x7c34 0x9278
0x7c35 0x92e7
0x7c36 0x92d7
0x7c37 0x92d9
0x7c38 0x92d0
0x7c39 0xfa27
0x7c3a 0x92d5
0x7c3b 0x92e0
0x7c3c 0x92d3
0x7c3d 0x9325
0x7c3e 0x9321
0x7c3f 0x92fb
0x7c40 0xfa28
0x7c41 0x931e
0x7c42 0x92ff
0x7c43 0x931d
0x7c44 0x9302
0x7c45 0x9370
0x7c46 0x9357
0x7c47 0x93a4
0x7c48 0x93c6
0x7c49 0x93de
0x7c4a 0x93f8
0x7c4b 0x9431
0x7c4c 0x9445
0x7c4d 0x9448
0x7c4e 0x9592
0x7c4f 0xf9dc
0x7c50 0xfa29
0x7c51 0x969d
0x7c52 0x96af
0x7c53 0x9733
0x7c54 0x973b
0x7c55 0x9743
0x7c56 0x974d
0x7c57 0x974f
0x7c58 0x9751
0x7c59 0x9755
0x7c5a 0x9857
0x7c5b 0x9865
0x7c5c 0xfa2a
0x7c5d 0xfa2b
0x7c5e 0x9927
0x7c5f 0xfa2c
0x7c60 0x999e
0x7c61 0x9a4e
0x7c62 0x9ad9
0x7c63 0x9adc
0x7c64 0x9b75
0x7c65 0x9b72
0x7c66 0x9b8f
0x7c67 0x9bb1
0x7c68 0x9bbb
0x7c69 0x9c00
0x7c6a 0x9d70
0x7c6b 0x9d6b
0x7c6c 0xfa2d
0x7c6d 0x9e19
0x7c6e 0x9ed1
0x7c71 0x2170
0x7c72 0x2171
0x7c73 0x2172
0x7c74 0x2173
0x7c75 0x2174
0x7c76 0x2175
0x7c77 0x2176
0x7c78 0x2177
0x7c79 0x2178
0x7c7a 0x2179
0x7c7b 0x3052
0x7c7c 0x00a6
0x7c7d 0xff07
0x7c7e 0xff02
0x9321 0x2170
0x9322 0x2171
0x9323 0x2172
0x9324 0x2173
0x9325 0x2174
0x9326 0x2175
0x9327 0x2176
0x9328 0x2177
0x9329 0x2178
0x932a 0x2179
0x932b 0x2160
0x932c 0x2161
0x932d 0x2162
0x932e 0x2163
0x932f 0x2164
0x9330 0x2165
0x9331 0x2166
0x9332 0x2167
0x9333 0x2168
0x9334 0x2169
0x9335 0x3052
0x9336 0x00a6
0x9337 0xff07
0x9338 0xff02
0x9339 0x3231
0x933a 0x2116
0x933b 0x2121
0x933c 0x306e
0x933d 0x7e8a
0x933e 0x891c
0x933f 0x9348
0x9340 0x9288
0x9341 0x84dc
0x9342 0x4fc9
0x9343 0x70bb
0x9344 0x6631
0x9345 0x68c8
0x9346 0x92f9
0x9347 0x66fb
0x9348 0x5f45
0x9349 0x4e28
0x934a 0x4ee1
0x934b 0x4efc
0x934c 0x4f00
0x934d 0x4f03
0x934e 0x4f39
0x934f 0x4f56
0x9350 0x4f92
0x9351 0x4f8a
0x9352 0x4f9a
0x9353 0x4f94
0x9354 0x4fcd
0x9355 0x5040
0x9356 0x5022
0x9357 0x4fff
0x9358 0x501e
0x9359 0x5046
0x935a 0x5070
0x935b 0x5042
0x935c 0x5094
0x935d 0x50f4
0x935e 0x50d8
0x935f 0x514a
0x9360 0x5164
0x9361 0x519d
0x9362 0x51be
0x9363 0x51ec
0x9364 0x5215
0x9365 0x529c
0x9366 0x52a6
0x9367 0x52c0
0x9368 0x52db
0x9369 0x5300
0x936a 0x5307
0x936b 0x5324
0x936c 0x5372
0x936d 0x5393
0x936e 0x53b2
0x936f 0x53dd
0x9370 0xfa0e
0x9371 0x549c
0x9372 0x548a
0x9373 0x54a9
0x9374 0x54ff
0x9375 0x5586
0x9376 0x5759
0x9377 0x5765
0x9378 0x57ac
0x9379 0x57c8
0x937a 0x57c7
0x937b 0xfa0f
0x937c 0xfa10
0x937d 0x589e
0x937e 0x58b2
0x9421 0x590b
0x9422 0x5953
0x9423 0x595b
0x9424 0x595d
0x9425 0x5963
0x9426 0x59a4
0x9427 0x59ba
0x9428 0x5b56
0x9429 0x5bc0
0x942a 0x752f
0x942b 0x5bd8
0x942c 0x5bec
0x942d 0x5c1e
0x942e 0x5ca6
0x942f 0x5cba
0x9430 0x5cf5
0x9431 0x5d27
0x9432 0x5d53
0x9433 0xfa11
0x9434 0x5d42
0x9435 0x5d6d
0x9436 0x5db8
0x9437 0x5db9
0x9438 0x5dd0
0x9439 0x5f21
0x943a 0x5f34
0x943b 0x5f67
0x943c 0x5fb7
0x943d 0x5fde
0x943e 0x605d
0x943f 0x6085
0x9440 0x608a
0x9441 0x60de
0x9442 0x60d5
0x9443 0x6120
0x9444 0x60f2
0x9445 0x6111
0x9446 0x6137
0x9447 0x6130
0x9448 0x6198
0x9449 0x6213
0x944a 0x62a6
0x944b 0x63f5
0x944c 0x6460
0x944d 0x649d
0x944e 0x64ce
0x944f 0x654e
0x9450 0x6600
0x9451 0x6615
0x9452 0x663b
0x9453 0x6609
0x9454 0x662e
0x9455 0x661e
0x9456 0x6624
0x9457 0x6665
0x9458 0x6657
0x9459 0x6659
0x945a 0xfa12
0x945b 0x6673
0x945c 0x6699
0x945d 0x66a0
0x945e 0x66b2
0x945f 0x66bf
0x9460 0x66fa
0x9461 0x670e
0x9462 0xf929
0x9463 0x6766
0x9464 0x67bb
0x9465 0x6852
0x9466 0x67c0
0x9467 0x6801
0x9468 0x6844
0x9469 0x68cf
0x946a 0xfa13
0x946b 0x6968
0x946c 0xfa14
0x946d 0x6998
0x946e 0x69e2
0x946f 0x6a30
0x9470 0x6a6b
0x9471 0x6a46
0x9472 0x6a73
0x9473 0x6a7e
0x9474 0x6ae2
0x9475 0x6ae4
0x9476 0x6bd6
0x9477 0x6c3f
0x9478 0x6c5c
0x9479 0x6c86
0x947a 0x6c6f
0x947b 0x6cda
0x947c 0x6d04
0x947d 0x6d87
0x947e 0x6d6f
0x9521 0x6d96
0x9522 0x6dac
0x9523 0x6dcf
0x9524 0x6df8
0x9525 0x6df2
0x9526 0x6dfc
0x9527 0x6e39
0x9528 0x6e5c
0x9529 0x6e27
0x952a 0x6e3c
0x952b 0x6ebf
0x952c 0x6f88
0x952d 0x6fb5
0x952e 0x6ff5
0x952f 0x7005
0x9530 0x7007
0x9531 0x7028
0x9532 0x7085
0x9533 0x70ab
0x9534 0x710f
0x9535 0x7104
0x9536 0x715c
0x9537 0x7146
0x9538 0x7147
0x9539 0xfa15
0x953a 0x71c1
0x953b 0x71fe
0x953c 0x72b1
0x953d 0x72be
0x953e 0x7324
0x953f 0xfa16
0x9540 0x7377
0x9541 0x73bd
0x9542 0x73c9
0x9543 0x73d6
0x9544 0x73e3
0x9545 0x73d2
0x9546 0x7407
0x9547 0x73f5
0x9548 0x7426
0x9549 0x742a
0x954a 0x7429
0x954b 0x742e
0x954c 0x7462
0x954d 0x7489
0x954e 0x749f
0x954f 0x7501
0x9550 0x756f
0x9551 0x7682
0x9552 0x769c
0x9553 0x769e
0x9554 0x769b
0x9555 0x76a6
0x9556 0xfa17
0x9557 0x7746
0x9558 0x52af
0x9559 0x7821
0x955a 0x784e
0x955b 0x7864
0x955c 0x787a
0x955d 0x7930
0x955e 0xfa18
0x955f 0xfa19
0x9560 0xfa1a
0x9561 0x7994
0x9562 0xfa1b
0x9563 0x799b
0x9564 0x7ad1
0x9565 0x7ae7
0x9566 0xfa1c
0x9567 0x7aeb
0x9568 0x7b9e
0x9569 0xfa1d
0x956a 0x7d48
0x956b 0x7d5c
0x956c 0x7db7
0x956d 0x7da0
0x956e 0x7dd6
0x956f 0x7e52
0x9570 0x7f47
0x9571 0x7fa1
0x9572 0xfa1e
0x9573 0x8301
0x9574 0x8362
0x9575 0x837f
0x9576 0x83c7
0x9577 0x83f6
0x9578 0x8448
0x9579 0x84b4
0x957a 0x8553
0x957b 0x8559
0x957c 0x856b
0x957d 0xfa1f
0x957e 0x85b0
0x9621 0xfa20
0x9622 0xfa21
0x9623 0x8807
0x9624 0x88f5
0x9625 0x8a12
0x9626 0x8a37
0x9627 0x8a79
0x9628 0x8aa7
0x9629 0x8abe
0x962a 0x8adf
0x962b 0xfa22
0x962c 0x8af6
0x962d 0x8b53
0x962e 0x8b7f
0x962f 0x8cf0
0x9630 0x8cf4
0x9631 0x8d12
0x9632 0x8d76
0x9633 0xfa23
0x9634 0x8ecf
0x9635 0xfa24
0x9636 0xfa25
0x9637 0x9067
0x9638 0x90de
0x9639 0xfa26
0x963a 0x9115
0x963b 0x9127
0x963c 0x91da
0x963d 0x91d7
0x963e 0x91de
0x963f 0x91ed
0x9640 0x91ee
0x9641 0x91e4
0x9642 0x91e5
0x9643 0x9206
0x9644 0x9210
0x9645 0x920a
0x9646 0x923a
0x9647 0x9240
0x9648 0x923c
0x9649 0x924e
0x964a 0x9259
0x964b 0x9251
0x964c 0x9239
0x964d 0x9267
0x964e 0x92a7
0x964f 0x9277
0x9650 0x9278
0x9651 0x92e7
0x9652 0x92d7
0x9653 0x92d9
0x9654 0x92d0
0x9655 0xfa27
0x9656 0x92d5
0x9657 0x92e0
0x9658 0x92d3
0x9659 0x9325
0x965a 0x9321
0x965b 0x92fb
0x965c 0xfa28
0x965d 0x931e
0x965e 0x92ff
0x965f 0x931d
0x9660 0x9302
0x9661 0x9370
0x9662 0x9357
0x9663 0x93a4
0x9664 0x93c6
0x9665 0x93de
0x9666 0x93f8
0x9667 0x9431
0x9668 0x9445
0x9669 0x9448
0x966a 0x9592
0x966b 0xf9dc
0x966c 0xfa29
0x966d 0x969d
0x966e 0x96af
0x966f 0x9733
0x9670 0x973b
0x9671 0x9743
0x9672 0x974d
0x9673 0x974f
0x9674 0x9751
0x9675 0x9755
0x9676 0x9857
0x9677 0x9865
0x9678 0xfa2a
0x9679 0xfa2b
0x967a 0x9927
0x967b 0xfa2c
0x967c 0x999e
0x967d 0x9a4e
0x967e 0x9ad9
0x9721 0x9adc
0x9722 0x9b75
0x9723 0x9b72
0x9724 0x9b8f
0x9725 0x9bb1
0x9726 0x9bbb
0x9727 0x9c00
0x9728 0x9d70
0x9729 0x9d6b
0x972a 0xfa2d
0x972b 0x9e19
0x972c 0x9ed1

View File

@ -0,0 +1,387 @@
0x7921 0x7e8a
0x7922 0x891c
0x7923 0x9348
0x7924 0x9288
0x7925 0x84dc
0x7926 0x4fc9
0x7927 0x70bb
0x7928 0x6631
0x7929 0x68c8
0x792a 0x92f9
0x792b 0x66fb
0x792c 0x5f45
0x792d 0x4e28
0x792e 0x4ee1
0x792f 0x4efc
0x7930 0x4f00
0x7931 0x4f03
0x7932 0x4f39
0x7933 0x4f56
0x7934 0x4f92
0x7935 0x4f8a
0x7936 0x4f9a
0x7937 0x4f94
0x7938 0x4fcd
0x7939 0x5040
0x793a 0x5022
0x793b 0x4fff
0x793c 0x501e
0x793d 0x5046
0x793e 0x5070
0x793f 0x5042
0x7940 0x5094
0x7941 0x50f4
0x7942 0x50d8
0x7943 0x514a
0x7944 0x5164
0x7945 0x519d
0x7946 0x51be
0x7947 0x51ec
0x7948 0x5215
0x7949 0x529c
0x794a 0x52a6
0x794b 0x52c0
0x794c 0x52db
0x794d 0x5300
0x794e 0x5307
0x794f 0x5324
0x7950 0x5372
0x7951 0x5393
0x7952 0x53b2
0x7953 0x53dd
0x7954 0xfa0e
0x7955 0x549c
0x7956 0x548a
0x7957 0x54a9
0x7958 0x54ff
0x7959 0x5586
0x795a 0x5759
0x795b 0x5765
0x795c 0x57ac
0x795d 0x57c8
0x795e 0x57c7
0x795f 0xfa0f
0x7960 0xfa10
0x7961 0x589e
0x7962 0x58b2
0x7963 0x590b
0x7964 0x5953
0x7965 0x595b
0x7966 0x595d
0x7967 0x5963
0x7968 0x59a4
0x7969 0x59ba
0x796a 0x5b56
0x796b 0x5bc0
0x796c 0x752f
0x796d 0x5bd8
0x796e 0x5bec
0x796f 0x5c1e
0x7970 0x5ca6
0x7971 0x5cba
0x7972 0x5cf5
0x7973 0x5d27
0x7974 0x5d53
0x7975 0xfa11
0x7976 0x5d42
0x7977 0x5d6d
0x7978 0x5db8
0x7979 0x5db9
0x797a 0x5dd0
0x797b 0x5f21
0x797c 0x5f34
0x797d 0x5f67
0x797e 0x5fb7
0x7a21 0x5fde
0x7a22 0x605d
0x7a23 0x6085
0x7a24 0x608a
0x7a25 0x60de
0x7a26 0x60d5
0x7a27 0x6120
0x7a28 0x60f2
0x7a29 0x6111
0x7a2a 0x6137
0x7a2b 0x6130
0x7a2c 0x6198
0x7a2d 0x6213
0x7a2e 0x62a6
0x7a2f 0x63f5
0x7a30 0x6460
0x7a31 0x649d
0x7a32 0x64ce
0x7a33 0x654e
0x7a34 0x6600
0x7a35 0x6615
0x7a36 0x663b
0x7a37 0x6609
0x7a38 0x662e
0x7a39 0x661e
0x7a3a 0x6624
0x7a3b 0x6665
0x7a3c 0x6657
0x7a3d 0x6659
0x7a3e 0xfa12
0x7a3f 0x6673
0x7a40 0x6699
0x7a41 0x66a0
0x7a42 0x66b2
0x7a43 0x66bf
0x7a44 0x66fa
0x7a45 0x670e
0x7a46 0xf929
0x7a47 0x6766
0x7a48 0x67bb
0x7a49 0x6852
0x7a4a 0x67c0
0x7a4b 0x6801
0x7a4c 0x6844
0x7a4d 0x68cf
0x7a4e 0xfa13
0x7a4f 0x6968
0x7a50 0xfa14
0x7a51 0x6998
0x7a52 0x69e2
0x7a53 0x6a30
0x7a54 0x6a6b
0x7a55 0x6a46
0x7a56 0x6a73
0x7a57 0x6a7e
0x7a58 0x6ae2
0x7a59 0x6ae4
0x7a5a 0x6bd6
0x7a5b 0x6c3f
0x7a5c 0x6c5c
0x7a5d 0x6c86
0x7a5e 0x6c6f
0x7a5f 0x6cda
0x7a60 0x6d04
0x7a61 0x6d87
0x7a62 0x6d6f
0x7a63 0x6d96
0x7a64 0x6dac
0x7a65 0x6dcf
0x7a66 0x6df8
0x7a67 0x6df2
0x7a68 0x6dfc
0x7a69 0x6e39
0x7a6a 0x6e5c
0x7a6b 0x6e27
0x7a6c 0x6e3c
0x7a6d 0x6ebf
0x7a6e 0x6f88
0x7a6f 0x6fb5
0x7a70 0x6ff5
0x7a71 0x7005
0x7a72 0x7007
0x7a73 0x7028
0x7a74 0x7085
0x7a75 0x70ab
0x7a76 0x710f
0x7a77 0x7104
0x7a78 0x715c
0x7a79 0x7146
0x7a7a 0x7147
0x7a7b 0xfa15
0x7a7c 0x71c1
0x7a7d 0x71fe
0x7a7e 0x72b1
0x7b21 0x72be
0x7b22 0x7324
0x7b23 0xfa16
0x7b24 0x7377
0x7b25 0x73bd
0x7b26 0x73c9
0x7b27 0x73d6
0x7b28 0x73e3
0x7b29 0x73d2
0x7b2a 0x7407
0x7b2b 0x73f5
0x7b2c 0x7426
0x7b2d 0x742a
0x7b2e 0x7429
0x7b2f 0x742e
0x7b30 0x7462
0x7b31 0x7489
0x7b32 0x749f
0x7b33 0x7501
0x7b34 0x756f
0x7b35 0x7682
0x7b36 0x769c
0x7b37 0x769e
0x7b38 0x769b
0x7b39 0x76a6
0x7b3a 0xfa17
0x7b3b 0x7746
0x7b3c 0x52af
0x7b3d 0x7821
0x7b3e 0x784e
0x7b3f 0x7864
0x7b40 0x787a
0x7b41 0x7930
0x7b42 0xfa18
0x7b43 0xfa19
0x7b44 0xfa1a
0x7b45 0x7994
0x7b46 0xfa1b
0x7b47 0x799b
0x7b48 0x7ad1
0x7b49 0x7ae7
0x7b4a 0xfa1c
0x7b4b 0x7aeb
0x7b4c 0x7b9e
0x7b4d 0xfa1d
0x7b4e 0x7d48
0x7b4f 0x7d5c
0x7b50 0x7db7
0x7b51 0x7da0
0x7b52 0x7dd6
0x7b53 0x7e52
0x7b54 0x7f47
0x7b55 0x7fa1
0x7b56 0xfa1e
0x7b57 0x8301
0x7b58 0x8362
0x7b59 0x837f
0x7b5a 0x83c7
0x7b5b 0x83f6
0x7b5c 0x8448
0x7b5d 0x84b4
0x7b5e 0x8553
0x7b5f 0x8559
0x7b60 0x856b
0x7b61 0xfa1f
0x7b62 0x85b0
0x7b63 0xfa20
0x7b64 0xfa21
0x7b65 0x8807
0x7b66 0x88f5
0x7b67 0x8a12
0x7b68 0x8a37
0x7b69 0x8a79
0x7b6a 0x8aa7
0x7b6b 0x8abe
0x7b6c 0x8adf
0x7b6d 0xfa22
0x7b6e 0x8af6
0x7b6f 0x8b53
0x7b70 0x8b7f
0x7b71 0x8cf0
0x7b72 0x8cf4
0x7b73 0x8d12
0x7b74 0x8d76
0x7b75 0xfa23
0x7b76 0x8ecf
0x7b77 0xfa24
0x7b78 0xfa25
0x7b79 0x9067
0x7b7a 0x90de
0x7b7b 0xfa26
0x7b7c 0x9115
0x7b7d 0x9127
0x7b7e 0x91da
0x7c21 0x91d7
0x7c22 0x91de
0x7c23 0x91ed
0x7c24 0x91ee
0x7c25 0x91e4
0x7c26 0x91e5
0x7c27 0x9206
0x7c28 0x9210
0x7c29 0x920a
0x7c2a 0x923a
0x7c2b 0x9240
0x7c2c 0x923c
0x7c2d 0x924e
0x7c2e 0x9259
0x7c2f 0x9251
0x7c30 0x9239
0x7c31 0x9267
0x7c32 0x92a7
0x7c33 0x9277
0x7c34 0x9278
0x7c35 0x92e7
0x7c36 0x92d7
0x7c37 0x92d9
0x7c38 0x92d0
0x7c39 0xfa27
0x7c3a 0x92d5
0x7c3b 0x92e0
0x7c3c 0x92d3
0x7c3d 0x9325
0x7c3e 0x9321
0x7c3f 0x92fb
0x7c40 0xfa28
0x7c41 0x931e
0x7c42 0x92ff
0x7c43 0x931d
0x7c44 0x9302
0x7c45 0x9370
0x7c46 0x9357
0x7c47 0x93a4
0x7c48 0x93c6
0x7c49 0x93de
0x7c4a 0x93f8
0x7c4b 0x9431
0x7c4c 0x9445
0x7c4d 0x9448
0x7c4e 0x9592
0x7c4f 0xf9dc
0x7c50 0xfa29
0x7c51 0x969d
0x7c52 0x96af
0x7c53 0x9733
0x7c54 0x973b
0x7c55 0x9743
0x7c56 0x974d
0x7c57 0x974f
0x7c58 0x9751
0x7c59 0x9755
0x7c5a 0x9857
0x7c5b 0x9865
0x7c5c 0xfa2a
0x7c5d 0xfa2b
0x7c5e 0x9927
0x7c5f 0xfa2c
0x7c60 0x999e
0x7c61 0x9a4e
0x7c62 0x9ad9
0x7c63 0x9adc
0x7c64 0x9b75
0x7c65 0x9b72
0x7c66 0x9b8f
0x7c67 0x9bb1
0x7c68 0x9bbb
0x7c69 0x9c00
0x7c6a 0x9d70
0x7c6b 0x9d6b
0x7c6c 0xfa2d
0x7c6d 0x9e19
0x7c6e 0x9ed1
0x7c71 0x2170
0x7c72 0x2171
0x7c73 0x2172
0x7c74 0x2173
0x7c75 0x2174
0x7c76 0x2175
0x7c77 0x2176
0x7c78 0x2177
0x7c79 0x2178
0x7c7a 0x2179
0x7c7b 0x3052
0x7c7c 0x00a6
0x7c7d 0xff07
0x7c7e 0xff02
0x932b 0x2160
0x932c 0x2161
0x932d 0x2162
0x932e 0x2163
0x932f 0x2164
0x9330 0x2165
0x9331 0x2166
0x9332 0x2167
0x9333 0x2168
0x9334 0x2169
0x9339 0x3231
0x933a 0x2116
0x933b 0x2121

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
0x742c 0x2116

View File

@ -0,0 +1,3 @@
0x005c 0x00a5
0x007e 0x203e

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,398 @@
0x8790 0x2252
0x8791 0x2261
0x8792 0x222b
0x8795 0x221a
0x8796 0x22a5
0x8797 0x2220
0x879a 0x2235
0x879b 0x2229
0x879c 0x222a
0xed40 0x7e8a
0xed41 0x891c
0xed42 0x9348
0xed43 0x9288
0xed44 0x84dc
0xed45 0x4fc9
0xed46 0x70bb
0xed47 0x6631
0xed48 0x68c8
0xed49 0x92f9
0xed4a 0x66fb
0xed4b 0x5f45
0xed4c 0x4e28
0xed4d 0x4ee1
0xed4e 0x4efc
0xed4f 0x4f00
0xed50 0x4f03
0xed51 0x4f39
0xed52 0x4f56
0xed53 0x4f92
0xed54 0x4f8a
0xed55 0x4f9a
0xed56 0x4f94
0xed57 0x4fcd
0xed58 0x5040
0xed59 0x5022
0xed5a 0x4fff
0xed5b 0x501e
0xed5c 0x5046
0xed5d 0x5070
0xed5e 0x5042
0xed5f 0x5094
0xed60 0x50f4
0xed61 0x50d8
0xed62 0x514a
0xed63 0x5164
0xed64 0x519d
0xed65 0x51be
0xed66 0x51ec
0xed67 0x5215
0xed68 0x529c
0xed69 0x52a6
0xed6a 0x52c0
0xed6b 0x52db
0xed6c 0x5300
0xed6d 0x5307
0xed6e 0x5324
0xed6f 0x5372
0xed70 0x5393
0xed71 0x53b2
0xed72 0x53dd
0xed73 0xfa0e
0xed74 0x549c
0xed75 0x548a
0xed76 0x54a9
0xed77 0x54ff
0xed78 0x5586
0xed79 0x5759
0xed7a 0x5765
0xed7b 0x57ac
0xed7c 0x57c8
0xed7d 0x57c7
0xed7e 0xfa0f
0xed80 0xfa10
0xed81 0x589e
0xed82 0x58b2
0xed83 0x590b
0xed84 0x5953
0xed85 0x595b
0xed86 0x595d
0xed87 0x5963
0xed88 0x59a4
0xed89 0x59ba
0xed8a 0x5b56
0xed8b 0x5bc0
0xed8c 0x752f
0xed8d 0x5bd8
0xed8e 0x5bec
0xed8f 0x5c1e
0xed90 0x5ca6
0xed91 0x5cba
0xed92 0x5cf5
0xed93 0x5d27
0xed94 0x5d53
0xed95 0xfa11
0xed96 0x5d42
0xed97 0x5d6d
0xed98 0x5db8
0xed99 0x5db9
0xed9a 0x5dd0
0xed9b 0x5f21
0xed9c 0x5f34
0xed9d 0x5f67
0xed9e 0x5fb7
0xed9f 0x5fde
0xeda0 0x605d
0xeda1 0x6085
0xeda2 0x608a
0xeda3 0x60de
0xeda4 0x60d5
0xeda5 0x6120
0xeda6 0x60f2
0xeda7 0x6111
0xeda8 0x6137
0xeda9 0x6130
0xedaa 0x6198
0xedab 0x6213
0xedac 0x62a6
0xedad 0x63f5
0xedae 0x6460
0xedaf 0x649d
0xedb0 0x64ce
0xedb1 0x654e
0xedb2 0x6600
0xedb3 0x6615
0xedb4 0x663b
0xedb5 0x6609
0xedb6 0x662e
0xedb7 0x661e
0xedb8 0x6624
0xedb9 0x6665
0xedba 0x6657
0xedbb 0x6659
0xedbc 0xfa12
0xedbd 0x6673
0xedbe 0x6699
0xedbf 0x66a0
0xedc0 0x66b2
0xedc1 0x66bf
0xedc2 0x66fa
0xedc3 0x670e
0xedc4 0xf929
0xedc5 0x6766
0xedc6 0x67bb
0xedc7 0x6852
0xedc8 0x67c0
0xedc9 0x6801
0xedca 0x6844
0xedcb 0x68cf
0xedcc 0xfa13
0xedcd 0x6968
0xedce 0xfa14
0xedcf 0x6998
0xedd0 0x69e2
0xedd1 0x6a30
0xedd2 0x6a6b
0xedd3 0x6a46
0xedd4 0x6a73
0xedd5 0x6a7e
0xedd6 0x6ae2
0xedd7 0x6ae4
0xedd8 0x6bd6
0xedd9 0x6c3f
0xedda 0x6c5c
0xeddb 0x6c86
0xeddc 0x6c6f
0xeddd 0x6cda
0xedde 0x6d04
0xeddf 0x6d87
0xede0 0x6d6f
0xede1 0x6d96
0xede2 0x6dac
0xede3 0x6dcf
0xede4 0x6df8
0xede5 0x6df2
0xede6 0x6dfc
0xede7 0x6e39
0xede8 0x6e5c
0xede9 0x6e27
0xedea 0x6e3c
0xedeb 0x6ebf
0xedec 0x6f88
0xeded 0x6fb5
0xedee 0x6ff5
0xedef 0x7005
0xedf0 0x7007
0xedf1 0x7028
0xedf2 0x7085
0xedf3 0x70ab
0xedf4 0x710f
0xedf5 0x7104
0xedf6 0x715c
0xedf7 0x7146
0xedf8 0x7147
0xedf9 0xfa15
0xedfa 0x71c1
0xedfb 0x71fe
0xedfc 0x72b1
0xee40 0x72be
0xee41 0x7324
0xee42 0xfa16
0xee43 0x7377
0xee44 0x73bd
0xee45 0x73c9
0xee46 0x73d6
0xee47 0x73e3
0xee48 0x73d2
0xee49 0x7407
0xee4a 0x73f5
0xee4b 0x7426
0xee4c 0x742a
0xee4d 0x7429
0xee4e 0x742e
0xee4f 0x7462
0xee50 0x7489
0xee51 0x749f
0xee52 0x7501
0xee53 0x756f
0xee54 0x7682
0xee55 0x769c
0xee56 0x769e
0xee57 0x769b
0xee58 0x76a6
0xee59 0xfa17
0xee5a 0x7746
0xee5b 0x52af
0xee5c 0x7821
0xee5d 0x784e
0xee5e 0x7864
0xee5f 0x787a
0xee60 0x7930
0xee61 0xfa18
0xee62 0xfa19
0xee63 0xfa1a
0xee64 0x7994
0xee65 0xfa1b
0xee66 0x799b
0xee67 0x7ad1
0xee68 0x7ae7
0xee69 0xfa1c
0xee6a 0x7aeb
0xee6b 0x7b9e
0xee6c 0xfa1d
0xee6d 0x7d48
0xee6e 0x7d5c
0xee6f 0x7db7
0xee70 0x7da0
0xee71 0x7dd6
0xee72 0x7e52
0xee73 0x7f47
0xee74 0x7fa1
0xee75 0xfa1e
0xee76 0x8301
0xee77 0x8362
0xee78 0x837f
0xee79 0x83c7
0xee7a 0x83f6
0xee7b 0x8448
0xee7c 0x84b4
0xee7d 0x8553
0xee7e 0x8559
0xee80 0x856b
0xee81 0xfa1f
0xee82 0x85b0
0xee83 0xfa20
0xee84 0xfa21
0xee85 0x8807
0xee86 0x88f5
0xee87 0x8a12
0xee88 0x8a37
0xee89 0x8a79
0xee8a 0x8aa7
0xee8b 0x8abe
0xee8c 0x8adf
0xee8d 0xfa22
0xee8e 0x8af6
0xee8f 0x8b53
0xee90 0x8b7f
0xee91 0x8cf0
0xee92 0x8cf4
0xee93 0x8d12
0xee94 0x8d76
0xee95 0xfa23
0xee96 0x8ecf
0xee97 0xfa24
0xee98 0xfa25
0xee99 0x9067
0xee9a 0x90de
0xee9b 0xfa26
0xee9c 0x9115
0xee9d 0x9127
0xee9e 0x91da
0xee9f 0x91d7
0xeea0 0x91de
0xeea1 0x91ed
0xeea2 0x91ee
0xeea3 0x91e4
0xeea4 0x91e5
0xeea5 0x9206
0xeea6 0x9210
0xeea7 0x920a
0xeea8 0x923a
0xeea9 0x9240
0xeeaa 0x923c
0xeeab 0x924e
0xeeac 0x9259
0xeead 0x9251
0xeeae 0x9239
0xeeaf 0x9267
0xeeb0 0x92a7
0xeeb1 0x9277
0xeeb2 0x9278
0xeeb3 0x92e7
0xeeb4 0x92d7
0xeeb5 0x92d9
0xeeb6 0x92d0
0xeeb7 0xfa27
0xeeb8 0x92d5
0xeeb9 0x92e0
0xeeba 0x92d3
0xeebb 0x9325
0xeebc 0x9321
0xeebd 0x92fb
0xeebe 0xfa28
0xeebf 0x931e
0xeec0 0x92ff
0xeec1 0x931d
0xeec2 0x9302
0xeec3 0x9370
0xeec4 0x9357
0xeec5 0x93a4
0xeec6 0x93c6
0xeec7 0x93de
0xeec8 0x93f8
0xeec9 0x9431
0xeeca 0x9445
0xeecb 0x9448
0xeecc 0x9592
0xeecd 0xf9dc
0xeece 0xfa29
0xeecf 0x969d
0xeed0 0x96af
0xeed1 0x9733
0xeed2 0x973b
0xeed3 0x9743
0xeed4 0x974d
0xeed5 0x974f
0xeed6 0x9751
0xeed7 0x9755
0xeed8 0x9857
0xeed9 0x9865
0xeeda 0xfa2a
0xeedb 0xfa2b
0xeedc 0x9927
0xeedd 0xfa2c
0xeede 0x999e
0xeedf 0x9a4e
0xeee0 0x9ad9
0xeee1 0x9adc
0xeee2 0x9b75
0xeee3 0x9b72
0xeee4 0x9b8f
0xeee5 0x9bb1
0xeee6 0x9bbb
0xeee7 0x9c00
0xeee8 0x9d70
0xeee9 0x9d6b
0xeeea 0xfa2d
0xeeeb 0x9e19
0xeeec 0x9ed1
0xeeef 0x2170
0xeef0 0x2171
0xeef1 0x2172
0xeef2 0x2173
0xeef3 0x2174
0xeef4 0x2175
0xeef5 0x2176
0xeef6 0x2177
0xeef7 0x2178
0xeef8 0x2179
0xeef9 0x3052
0xeefa 0x00a6
0xeefb 0xff07
0xeefc 0xff02
0xfa4a 0x2160
0xfa4b 0x2161
0xfa4c 0x2162
0xfa4d 0x2163
0xfa4e 0x2164
0xfa4f 0x2165
0xfa50 0x2166
0xfa51 0x2167
0xfa52 0x2168
0xfa53 0x2169
0xfa54 0x3052
0xfa58 0x3231
0xfa59 0x2116
0xfa5a 0x2121
0xfa5b 0x306e

View File

@ -0,0 +1,3 @@
0x005c 0x00a5
0x007e 0x203e

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,8 @@ MS936 x-mswin-936 MS936 basic sun.nio.cs.ext true 0x81 0xfe 0x
MS949 x-windows-949 MS949 basic sun.nio.cs.ext true 0x81 0xfe 0x41 0xfe
MS950 x-windows-950 MS950 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
GBK GBK GBK basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
SJIS Shift_JIS SJIS basic sun.nio.cs.ext true 0x81 0xfc 0x40 0xfc
PCK x-PCK PCK basic sun.nio.cs.ext true 0x81 0xfc 0x40 0xfc
IBM1364 x-IBM1364 Cp1364 ebcdic sun.nio.cs.ext false 0x40 0xde 0x40 0xfe
IBM1381 x-IBM1381 Cp1381 basic sun.nio.cs.ext true 0x8c 0xf7 0xa1 0xfe
IBM1383 x-IBM1383 Cp1383 euc_sim sun.nio.cs.ext true 0xa1 0xfe 0xa1 0xfe
@ -24,3 +26,10 @@ IBM948 x-IBM948 Cp948 basic sun.nio.cs.ext true 0x81 0xfe 0
IBM949 x-IBM949 Cp949 basic sun.nio.cs.ext false 0x8f 0xfe 0xa1 0xfe
IBM950 x-IBM950 Cp950 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
IBM970 x-IBM970 Cp970 euc_sim sun.nio.cs.ext true 0xa1 0xfe 0xa1 0xfe
JIS_X_0208 x-JIS0208 JIS0208 dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
JIS_X_0212 JIS_X0212-1990 JIS0212 dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
JIS_X_0208_Solaris x-JIS0208_Solaris JIS0208_Solaris dbcsonly sun.nio.cs.ext false 0x21 0x9e 0x21 0x7e
JIS_X_0208_MS5022X x-JIS0208_MS5022X JIS0208_MS5022X dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
JIS_X_0208_MS932 x-JIS0208_MS932 JIS0208_MS932 dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
JIS_X_0212_Solaris x-JIS0212_Solaris JIS0212_Solaris dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
JIS_X_0212_MS5022X x-JIS0212_MS5022X JIS0212_MS5022X dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e

View File

@ -53,7 +53,7 @@ ISO_8859_11 x-iso-8859-11 x-iso-8859-11 true sun.nio.cs.ext
ISO_8859_3 ISO-8859-3 ISO8859_3 true sun.nio.cs.ext
ISO_8859_6 ISO-8859-6 ISO8859_6 true sun.nio.cs.ext
ISO_8859_8 ISO-8859-8 ISO8859_8 true sun.nio.cs.ext
#JIS_X_0201 JIS_X0201 JIS_X0201 true sun.nio.cs.ext
JIS_X_0201 JIS_X0201 JIS_X0201 true sun.nio.cs.ext
MS1255 windows-1255 Cp1255 true sun.nio.cs.ext
MS1256 windows-1256 Cp1256 true sun.nio.cs.ext
MS1258 windows-1258 Cp1258 true sun.nio.cs.ext

View File

@ -194,6 +194,15 @@ public class DBCS {
if (hisName == null)
hisName = "";
// (5) c2b replacement, only used for JIs0208/0212, which
// are two pure db charsets so default '3f' does not work
String c2bRepl = "";
if (clzName.startsWith("JIS_X_0208")) {
c2bRepl = "new byte[]{ (byte)0x21, (byte)0x29 },";
} else if (clzName.startsWith("JIS_X_0212")) {
c2bRepl = "new byte[]{ (byte)0x22, (byte)0x44 },";
}
while (s.hasNextLine()) {
String line = s.nextLine();
if (line.indexOf("$") == -1) {
@ -227,7 +236,8 @@ public class DBCS {
.replace("$B2C$", b2c)
.replace("$C2BLENGTH$", "0x" + Integer.toString(c2bOff, 16))
.replace("$NONROUNDTRIP_B2C$", b2cNR)
.replace("$NONROUNDTRIP_C2B$", c2bNR);
.replace("$NONROUNDTRIP_C2B$", c2bNR)
.replace("$ENC_REPLACEMENT$", c2bRepl);
ops.println(line);
}

View File

@ -106,7 +106,7 @@ public class SBCS {
}
}
static Pattern sbmap = Pattern.compile("0x(\\p{XDigit}++)\\s++U\\+(\\p{XDigit}++)(\\s++#.*)?");
static Pattern sbmap = Pattern.compile("0x(\\p{XDigit}++)\\s++(?:U\\+|0x)?(\\p{XDigit}++)(?:\\s++#.*)?");
private static void genClass0(String srcDir, String dstDir,
String template,

View File

@ -107,7 +107,7 @@ public class SingleByte
return decodeBufferLoop(src, dst);
}
private final char decode(int b) {
public final char decode(int b) {
return b2c[b + 128];
}
@ -221,7 +221,7 @@ public class SingleByte
return encodeBufferLoop(src, dst);
}
private final int encode(char ch) {
public final int encode(char ch) {
char index = c2bIndex[ch >> 8];
if (index == UNMAPPABLE_ENCODING)
return UNMAPPABLE_ENCODING;

View File

@ -249,11 +249,11 @@ public class DoubleByte {
}
public char decodeDouble(int b1, int b2) {
if (b2 < b2Min || b2 > b2Max)
if (b1 < 0 || b1 > b2c.length ||
b2 < b2Min || b2 > b2Max)
return UNMAPPABLE_DECODING;
return b2c[b1][b2 - b2Min];
}
}
// IBM_EBCDIC_DBCS
@ -435,15 +435,15 @@ public class DoubleByte {
}
}
// EBCDIC_DBCS_ONLY
public static class Decoder_EBCDIC_DBCSONLY extends Decoder {
static final char[] b2cSB;
// DBCS_ONLY
public static class Decoder_DBCSONLY extends Decoder {
static final char[] b2cSB_UNMAPPABLE;
static {
b2cSB = new char[0x100];
Arrays.fill(b2cSB, UNMAPPABLE_DECODING);
b2cSB_UNMAPPABLE = new char[0x100];
Arrays.fill(b2cSB_UNMAPPABLE, UNMAPPABLE_DECODING);
}
Decoder_EBCDIC_DBCSONLY(Charset cs, char[][] b2c, int b2Min, int b2Max) {
super(cs, 0.5f, 1.0f, b2c, b2cSB, b2Min, b2Max);
Decoder_DBCSONLY(Charset cs, char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
super(cs, 0.5f, 1.0f, b2c, b2cSB_UNMAPPABLE, b2Min, b2Max);
}
}
@ -727,9 +727,9 @@ public class DoubleByte {
}
}
public static class Encoder_EBCDIC_DBCSONLY extends Encoder {
Encoder_EBCDIC_DBCSONLY(Charset cs, byte[] repl,
char[] c2b, char[] c2bIndex) {
public static class Encoder_DBCSONLY extends Encoder {
Encoder_DBCSONLY(Charset cs, byte[] repl,
char[] c2b, char[] c2bIndex) {
super(cs, 2.0f, 2.0f, repl, c2b, c2bIndex);
}
@ -741,6 +741,8 @@ public class DoubleByte {
}
}
public static class Encoder_EBCDIC extends Encoder {
static final int SBCS = 0;
static final int DBCS = 1;
@ -911,4 +913,5 @@ public class DoubleByte {
super(cs, c2b, c2bIndex);
}
}
}

View File

@ -1,182 +0,0 @@
/*
* Copyright (c) 2002, 2005, Oracle and/or its affiliates. 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
*/
package sun.nio.cs.ext;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CoderResult;
abstract class DoubleByteDecoder
extends CharsetDecoder
{
private short index1[];
/*
* 2nd level index, provided by subclass
* every string has 0x10*(end-start+1) characters.
*/
private String index2[];
protected int start;
protected int end;
protected static final char REPLACE_CHAR = '\uFFFD';
protected char highSurrogate;
protected char lowSurrogate;
protected DoubleByteDecoder(Charset cs, short[] index1, String[] index2,
int start, int end ) {
super(cs, 0.5f, 1.0f);
this.index1 = index1;
this.index2 = index2;
this.start = start;
this.end = end;
}
private CoderResult decodeArrayLoop(ByteBuffer src, CharBuffer dst) {
byte[] sa = src.array();
int sp = src.arrayOffset() + src.position();
int sl = src.arrayOffset() + src.limit();
assert (sp <= sl);
sp = (sp <= sl ? sp : sl);
char[] da = dst.array();
int dp = dst.arrayOffset() + dst.position();
int dl = dst.arrayOffset() + dst.limit();
assert (dp <= dl);
dp = (dp <= dl ? dp : dl);
try {
while (sp < sl) {
int b1, b2;
b1 = sa[sp];
int inputSize = 1;
int outputSize = 1;
highSurrogate = lowSurrogate = 0;
char c = decodeSingle(b1);
if (c == REPLACE_CHAR) {
b1 &= 0xff;
if (sl - sp < 2)
return CoderResult.UNDERFLOW;
b2 = sa[sp + 1] & 0xff;
c = decodeDouble(b1, b2);
inputSize = 2;
if (c == REPLACE_CHAR)
return CoderResult.unmappableForLength(inputSize);
outputSize = (highSurrogate > 0) ? 2: 1;
}
if (dl - dp < outputSize)
return CoderResult.OVERFLOW;
if (outputSize == 2) {
da[dp++] = highSurrogate;
da[dp++] = lowSurrogate;
} else {
da[dp++] = c;
}
sp += inputSize;
}
return CoderResult.UNDERFLOW;
} finally {
src.position(sp - src.arrayOffset());
dst.position(dp - dst.arrayOffset());
}
}
private CoderResult decodeBufferLoop(ByteBuffer src, CharBuffer dst) {
int mark = src.position();
int inputSize = 0;
int outputSize = 0;
try {
while (src.hasRemaining()) {
int b1 = src.get();
inputSize = 1;
outputSize = 1;
highSurrogate = lowSurrogate = 0;
char c = decodeSingle(b1);
if (c == REPLACE_CHAR) {
if (src.remaining() < 1)
return CoderResult.UNDERFLOW;
b1 &= 0xff;
int b2 = src.get() & 0xff;
inputSize = 2;
c = decodeDouble(b1, b2);
if (c == REPLACE_CHAR)
return CoderResult.unmappableForLength(2);
outputSize = (highSurrogate > 0) ? 2: 1;
}
if (dst.remaining() < outputSize)
return CoderResult.OVERFLOW;
mark += inputSize;
if (outputSize == 2) {
dst.put(highSurrogate);
dst.put(lowSurrogate);
} else {
dst.put(c);
}
}
return CoderResult.UNDERFLOW;
} finally {
src.position(mark);
}
}
protected CoderResult decodeLoop(ByteBuffer src, CharBuffer dst) {
if (src.hasArray() && dst.hasArray())
return decodeArrayLoop(src, dst);
else
return decodeBufferLoop(src, dst);
}
/*
* Can be changed by subclass
*/
protected char decodeSingle(int b) {
if (b >= 0)
return (char) b;
return REPLACE_CHAR;
}
protected char decodeDouble(int byte1, int byte2) {
if (((byte1 < 0) || (byte1 > index1.length))
|| ((byte2 < start) || (byte2 > end)))
return REPLACE_CHAR;
int n = (index1[byte1] & 0xf) * (end - start + 1) + (byte2 - start);
return index2[index1[byte1] >> 4].charAt(n);
}
}

View File

@ -23,9 +23,6 @@
* questions.
*/
/*
*/
package sun.nio.cs.ext;
import java.nio.ByteBuffer;
@ -36,6 +33,8 @@ import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import sun.nio.cs.HistoricallyNamedCharset;
import sun.nio.cs.Surrogate;
import sun.nio.cs.SingleByte;
import static sun.nio.cs.CharsetMapping.*;
public class EUC_JP
extends Charset
@ -62,52 +61,47 @@ public class EUC_JP
}
public CharsetEncoder newEncoder() {
// Need to force the replacement byte to 0x3f
// because JIS_X_0208_Encoder defines its own
// alternative 2 byte substitution to permit it
// to exist as a self-standing Encoder
byte[] replacementBytes = { (byte)0x3f };
return new Encoder(this).replaceWith(replacementBytes);
return new Encoder(this);
}
static class Decoder extends JIS_X_0208_Decoder
static class Decoder extends CharsetDecoder
implements DelegatableDecoder {
JIS_X_0201.Decoder decoderJ0201;
JIS_X_0212_Decoder decoderJ0212;
final static SingleByte.Decoder DEC0201 =
(SingleByte.Decoder)new JIS_X_0201().newDecoder();
private static final short[] j0208Index1 =
JIS_X_0208_Decoder.getIndex1();
private static final String[] j0208Index2 =
JIS_X_0208_Decoder.getIndex2();
final static DoubleByte.Decoder DEC0208 =
(DoubleByte.Decoder)new JIS_X_0208().newDecoder();
final static DoubleByte.Decoder DEC0212 =
(DoubleByte.Decoder)new JIS_X_0212().newDecoder();
private final SingleByte.Decoder dec0201;
private final DoubleByte.Decoder dec0208;
private final DoubleByte.Decoder dec0212;
protected Decoder(Charset cs) {
super(cs);
decoderJ0201 = new JIS_X_0201.Decoder(cs);
decoderJ0212 = new JIS_X_0212_Decoder(cs);
start = 0xa1;
end = 0xfe;
this(cs, 0.5f, 1.0f, DEC0201, DEC0208, DEC0212);
}
protected char decode0212(int byte1, int byte2) {
return decoderJ0212.decodeDouble(byte1, byte2);
protected Decoder(Charset cs, float avgCpb, float maxCpb,
SingleByte.Decoder dec0201,
DoubleByte.Decoder dec0208,
DoubleByte.Decoder dec0212) {
super(cs, avgCpb, maxCpb);
this.dec0201 = dec0201;
this.dec0208 = dec0208;
this.dec0212 = dec0212;
}
protected char decodeDouble(int byte1, int byte2) {
if (byte1 == 0x8e) {
return decoderJ0201.decode(byte2 - 256);
if (byte2 < 0x80)
return UNMAPPABLE_DECODING;
return dec0201.decode((byte)byte2);
}
// Fix for bug 4121358 - similar fix for bug 4117820 put
// into ByteToCharDoubleByte.getUnicode()
if (((byte1 < 0) || (byte1 > getIndex1().length))
|| ((byte2 < start) || (byte2 > end)))
return REPLACE_CHAR;
int n = (j0208Index1[byte1 - 0x80] & 0xf) * (end - start + 1)
+ (byte2 - start);
return j0208Index2[j0208Index1[byte1 - 0x80] >> 4].charAt(n);
return dec0208.decodeDouble(byte1 - 0x80, byte2 - 0x80);
}
private CoderResult decodeArrayLoop(ByteBuffer src,
@ -127,8 +121,7 @@ public class EUC_JP
int b1 = 0, b2 = 0;
int inputSize = 0;
char outputChar = REPLACE_CHAR; // U+FFFD;
char outputChar = UNMAPPABLE_DECODING;
try {
while (sp < sl) {
b1 = sa[sp] & 0xff;
@ -136,17 +129,17 @@ public class EUC_JP
if ((b1 & 0x80) == 0) {
outputChar = (char)b1;
}
else { // Multibyte char
if ((b1 & 0xff) == 0x8f) { // JIS0212
} else { // Multibyte char
if (b1 == 0x8f) { // JIS0212
if (sp + 3 > sl)
return CoderResult.UNDERFLOW;
b1 = sa[sp + 1] & 0xff;
b2 = sa[sp + 2] & 0xff;
inputSize += 2;
outputChar = decode0212(b1-0x80, b2-0x80);
} else {
// JIS0208
if (dec0212 == null) // JIS02012 not supported
return CoderResult.unmappableForLength(inputSize);
outputChar = dec0212.decodeDouble(b1-0x80, b2-0x80);
} else { // JIS0201, JIS0208
if (sp + 2 > sl)
return CoderResult.UNDERFLOW;
b2 = sa[sp + 1] & 0xff;
@ -154,7 +147,7 @@ public class EUC_JP
outputChar = decodeDouble(b1, b2);
}
}
if (outputChar == REPLACE_CHAR) { // can't be decoded
if (outputChar == UNMAPPABLE_DECODING) { // can't be decoded
return CoderResult.unmappableForLength(inputSize);
}
if (dp + 1 > dl)
@ -175,26 +168,25 @@ public class EUC_JP
int mark = src.position();
int b1 = 0, b2 = 0;
int inputSize = 0;
char outputChar = REPLACE_CHAR; // U+FFFD;
char outputChar = UNMAPPABLE_DECODING;
try {
while (src.hasRemaining()) {
b1 = src.get() & 0xff;
inputSize = 1;
if ((b1 & 0x80) == 0) {
outputChar = (char)b1;
} else { // Multibyte char
if ((b1 & 0xff) == 0x8f) { // JIS0212
} else { // Multibyte char
if (b1 == 0x8f) { // JIS0212
if (src.remaining() < 2)
return CoderResult.UNDERFLOW;
b1 = src.get() & 0xff;
b2 = src.get() & 0xff;
inputSize += 2;
outputChar = decode0212(b1-0x80, b2-0x80);
} else {
// JIS0208
if (dec0212 == null) // JIS02012 not supported
return CoderResult.unmappableForLength(inputSize);
outputChar = dec0212.decodeDouble(b1-0x80, b2-0x80);
} else { // JIS0201 JIS0208
if (src.remaining() < 1)
return CoderResult.UNDERFLOW;
b2 = src.get() & 0xff;
@ -202,8 +194,7 @@ public class EUC_JP
outputChar = decodeDouble(b1, b2);
}
}
if (outputChar == REPLACE_CHAR) {
if (outputChar == UNMAPPABLE_DECODING) {
return CoderResult.unmappableForLength(inputSize);
}
if (dst.remaining() < 1)
@ -233,65 +224,67 @@ public class EUC_JP
}
static class Encoder extends JIS_X_0208_Encoder {
static class Encoder extends CharsetEncoder {
JIS_X_0201.Encoder encoderJ0201;
JIS_X_0212_Encoder encoderJ0212;
final static SingleByte.Encoder ENC0201 =
(SingleByte.Encoder)new JIS_X_0201().newEncoder();
private static final short[] j0208Index1 =
JIS_X_0208_Encoder.getIndex1();
private static final String[] j0208Index2 =
JIS_X_0208_Encoder.getIndex2();
final static DoubleByte.Encoder ENC0208 =
(DoubleByte.Encoder)new JIS_X_0208().newEncoder();
final static DoubleByte.Encoder ENC0212 =
(DoubleByte.Encoder)new JIS_X_0212().newEncoder();
private final Surrogate.Parser sgp = new Surrogate.Parser();
private final SingleByte.Encoder enc0201;
private final DoubleByte.Encoder enc0208;
private final DoubleByte.Encoder enc0212;
protected Encoder(Charset cs) {
super(cs, 3.0f, 3.0f);
encoderJ0201 = new JIS_X_0201.Encoder(cs);
encoderJ0212 = new JIS_X_0212_Encoder(cs);
this(cs, 3.0f, 3.0f, ENC0201, ENC0208, ENC0212);
}
protected Encoder(Charset cs, float avgBpc, float maxBpc,
SingleByte.Encoder enc0201,
DoubleByte.Encoder enc0208,
DoubleByte.Encoder enc0212) {
super(cs, avgBpc, maxBpc);
this.enc0201 = enc0201;
this.enc0208 = enc0208;
this.enc0212 = enc0212;
}
public boolean canEncode(char c) {
byte[] encodedBytes = new byte[3];
if (encodeSingle(c, encodedBytes) == 0) { //doublebyte
if (encodeDouble(c) == 0)
return false;
}
return true;
return encodeSingle(c, encodedBytes) != 0 ||
encodeDouble(c) != UNMAPPABLE_ENCODING;
}
protected int encodeSingle(char inputChar, byte[] outputByte) {
byte b;
if (inputChar == 0) {
outputByte[0] = (byte)0;
return 1;
}
if ((b = encoderJ0201.encode(inputChar)) == 0)
int b = enc0201.encode(inputChar);
if (b == UNMAPPABLE_ENCODING)
return 0;
if (b > 0 && b < 128) {
outputByte[0] = b;
if (b >= 0 && b < 128) {
outputByte[0] = (byte)b;
return 1;
}
outputByte[0] = (byte)0x8e;
outputByte[1] = b;
outputByte[1] = (byte)b;
return 2;
}
protected int encodeDouble(char ch) {
int offset = j0208Index1[((ch & 0xff00) >> 8 )] << 8;
int r = j0208Index2[offset >> 12].charAt((offset & 0xfff) +
(ch & 0xff));
if (r != 0)
return r + 0x8080;
r = encoderJ0212.encodeDouble(ch);
if (r == 0)
return r;
return r + 0x8F8080;
int b = enc0208.encodeChar(ch);
if (b != UNMAPPABLE_ENCODING)
return b + 0x8080;
if (enc0212 != null) {
b = enc0212.encodeChar(ch);
if (b != UNMAPPABLE_ENCODING)
b += 0x8F8080;
}
return b;
}
private CoderResult encodeArrayLoop(CharBuffer src,
@ -317,18 +310,15 @@ public class EUC_JP
while (sp < sl) {
outputByte = tmpBuf;
char c = sa[sp];
if (Character.isSurrogate(c)) {
if (sgp.parse(c, sa, sp, sl) < 0)
return sgp.error();
return sgp.unmappableResult();
}
outputSize = encodeSingle(c, outputByte);
if (outputSize == 0) { // DoubleByte
int ncode = encodeDouble(c);
if (ncode != 0 ) {
if (ncode != UNMAPPABLE_ENCODING) {
if ((ncode & 0xFF0000) == 0) {
outputByte[0] = (byte) ((ncode & 0xff00) >> 8);
outputByte[1] = (byte) (ncode & 0xff);
@ -340,7 +330,7 @@ public class EUC_JP
outputSize = 3;
}
} else {
return CoderResult.unmappableForLength(1);
return CoderResult.unmappableForLength(1);
}
}
if (dl - dp < outputSize)
@ -377,11 +367,10 @@ public class EUC_JP
return sgp.error();
return sgp.unmappableResult();
}
outputSize = encodeSingle(c, outputByte);
if (outputSize == 0) { // DoubleByte
int ncode = encodeDouble(c);
if (ncode != 0 ) {
if (ncode != UNMAPPABLE_ENCODING) {
if ((ncode & 0xFF0000) == 0) {
outputByte[0] = (byte) ((ncode & 0xff00) >> 8);
outputByte[1] = (byte) (ncode & 0xff);
@ -393,10 +382,9 @@ public class EUC_JP
outputSize = 3;
}
} else {
return CoderResult.unmappableForLength(1);
return CoderResult.unmappableForLength(1);
}
}
if (dst.remaining() < outputSize)
return CoderResult.OVERFLOW;
// Put the byte in the output buffer

View File

@ -23,9 +23,6 @@
* questions.
*/
/*
*/
package sun.nio.cs.ext;
import java.nio.ByteBuffer;
@ -35,7 +32,6 @@ import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import sun.nio.cs.HistoricallyNamedCharset;
import sun.nio.cs.Surrogate;
public class EUC_JP_LINUX
extends Charset
@ -63,308 +59,15 @@ public class EUC_JP_LINUX
return new Encoder(this);
}
private static class Decoder extends CharsetDecoder {
JIS_X_0201.Decoder decoderJ0201;
protected final char REPLACE_CHAR='\uFFFD';
private static final int start = 0xa1;
private static final int end = 0xfe;
private static final short[] jis0208Index1 =
JIS_X_0208_Decoder.getIndex1();
private static final String[] jis0208Index2 =
JIS_X_0208_Decoder.getIndex2();
private static class Decoder extends EUC_JP.Decoder {
private Decoder(Charset cs) {
super(cs, 1.0f, 1.0f);
decoderJ0201 = new JIS_X_0201.Decoder(cs);
}
protected char convSingleByte(int b) {
if (b < 0 || b > 0x7f)
return REPLACE_CHAR;
return decoderJ0201.decode(b);
}
protected char decodeDouble(int byte1, int byte2) {
if (byte1 == 0x8e) {
return decoderJ0201.decode(byte2 - 256);
}
if (((byte1 < 0) || (byte1 > jis0208Index1.length))
|| ((byte2 < start) || (byte2 > end)))
return REPLACE_CHAR;
int n = (jis0208Index1[byte1 - 0x80] & 0xf) * (end - start + 1)
+ (byte2 - start);
return jis0208Index2[jis0208Index1[byte1 - 0x80] >> 4].charAt(n);
}
private CoderResult decodeArrayLoop(ByteBuffer src,
CharBuffer dst)
{
byte[] sa = src.array();
int sp = src.arrayOffset() + src.position();
int sl = src.arrayOffset() + src.limit();
assert (sp <= sl);
sp = (sp <= sl ? sp : sl);
char[] da = dst.array();
int dp = dst.arrayOffset() + dst.position();
int dl = dst.arrayOffset() + dst.limit();
assert (dp <= dl);
dp = (dp <= dl ? dp : dl);
int b1 = 0, b2 = 0;
int inputSize = 0;
char outputChar = REPLACE_CHAR; // U+FFFD;
try {
while (sp < sl) {
b1 = sa[sp] & 0xff;
inputSize = 1;
if ((b1 & 0x80) == 0) {
outputChar = (char)b1;
}
else { // Multibyte char
if ((b1 & 0xff) == 0x8f) { // JIS0212
if (sp + 3 > sl)
return CoderResult.UNDERFLOW;
inputSize = 3;
return CoderResult.unmappableForLength(inputSize); // substitute
} else {
// JIS0208
if (sp + 2 > sl)
return CoderResult.UNDERFLOW;
b2 = sa[sp + 1] & 0xff;
inputSize = 2;
outputChar = decodeDouble(b1, b2);
}
}
if (outputChar == REPLACE_CHAR) { // can't be decoded
return CoderResult.unmappableForLength(inputSize);
}
if (dp + 1 > dl)
return CoderResult.OVERFLOW;
da[dp++] = outputChar;
sp += inputSize;
}
return CoderResult.UNDERFLOW;
} finally {
src.position(sp - src.arrayOffset());
dst.position(dp - dst.arrayOffset());
}
}
private CoderResult decodeBufferLoop(ByteBuffer src,
CharBuffer dst)
{
int mark = src.position();
char outputChar = REPLACE_CHAR; // U+FFFD;
try {
while (src.hasRemaining()) {
int b1 = src.get() & 0xff;
int inputSize = 1;
if ((b1 & 0x80) == 0) {
outputChar = (char)b1;
} else { // Multibyte char
if ((b1 & 0xff) == 0x8f) { // JIS0212 not supported
if (src.remaining() < 2)
return CoderResult.UNDERFLOW;
return CoderResult.unmappableForLength(3);
} else {
// JIS0208
if (src.remaining() < 1)
return CoderResult.UNDERFLOW;
int b2 = src.get() & 0xff;
inputSize++;
outputChar = decodeDouble(b1, b2);
}
}
if (outputChar == REPLACE_CHAR)
return CoderResult.unmappableForLength(inputSize);
if (dst.remaining() < 1)
return CoderResult.OVERFLOW;
dst.put(outputChar);
mark += inputSize;
}
return CoderResult.UNDERFLOW;
} finally {
src.position(mark);
}
}
protected CoderResult decodeLoop(ByteBuffer src,
CharBuffer dst)
{
if (src.hasArray() && dst.hasArray())
return decodeArrayLoop(src, dst);
else
return decodeBufferLoop(src, dst);
super(cs, 1.0f, 1.0f, DEC0201, DEC0208, null);
}
}
private static class Encoder extends CharsetEncoder {
JIS_X_0201.Encoder encoderJ0201;
private final Surrogate.Parser sgp = new Surrogate.Parser();
private static final short[] jis0208Index1 =
JIS_X_0208_Encoder.getIndex1();
private static final String[] jis0208Index2 =
JIS_X_0208_Encoder.getIndex2();
private static class Encoder extends EUC_JP.Encoder {
private Encoder(Charset cs) {
super(cs, 2.0f, 2.0f);
encoderJ0201 = new JIS_X_0201.Encoder(cs);
}
public boolean canEncode(char c) {
byte[] encodedBytes = new byte[2];
if (encodeSingle(c, encodedBytes) == 0) { //doublebyte
if (encodeDouble(c) == 0)
return false;
}
return true;
}
protected int encodeSingle(char inputChar, byte[] outputByte) {
byte b;
if (inputChar == 0) {
outputByte[0] = (byte)0;
return 1;
}
if ((b = encoderJ0201.encode(inputChar)) == 0)
return 0;
if (b > 0 && b < 128) {
outputByte[0] = b;
return 1;
}
outputByte[0] = (byte)0x8e;
outputByte[1] = b;
return 2;
}
protected int encodeDouble(char ch) {
int offset = jis0208Index1[((ch & 0xff00) >> 8 )] << 8;
int r = jis0208Index2[offset >> 12].charAt((offset & 0xfff) + (ch & 0xff));
if (r != 0)
return r + 0x8080;
return r;
}
private CoderResult encodeArrayLoop(CharBuffer src,
ByteBuffer dst)
{
char[] sa = src.array();
int sp = src.arrayOffset() + src.position();
int sl = src.arrayOffset() + src.limit();
assert (sp <= sl);
sp = (sp <= sl ? sp : sl);
byte[] da = dst.array();
int dp = dst.arrayOffset() + dst.position();
int dl = dst.arrayOffset() + dst.limit();
assert (dp <= dl);
dp = (dp <= dl ? dp : dl);
final byte[] outputByte = new byte[2];
try {
while (sp < sl) {
char c = sa[sp];
if (Character.isSurrogate(c)) {
if (sgp.parse(c, sa, sp, sl) < 0)
return sgp.error();
return sgp.unmappableResult();
}
int outputSize = encodeSingle(c, outputByte);
if (outputSize == 0) { // DoubleByte
int ncode = encodeDouble(c);
if (ncode != 0 && ((ncode & 0xFF0000) == 0)) {
outputByte[0] = (byte) ((ncode & 0xff00) >> 8);
outputByte[1] = (byte) (ncode & 0xff);
outputSize = 2;
} else {
return CoderResult.unmappableForLength(1);
}
}
if (dl - dp < outputSize)
return CoderResult.OVERFLOW;
// Put the byte in the output buffer
for (int i = 0; i < outputSize; i++) {
da[dp++] = outputByte[i];
}
sp++;
}
return CoderResult.UNDERFLOW;
} finally {
src.position(sp - src.arrayOffset());
dst.position(dp - dst.arrayOffset());
}
}
private CoderResult encodeBufferLoop(CharBuffer src,
ByteBuffer dst)
{
final byte[] outputByte = new byte[4];
int mark = src.position();
try {
while (src.hasRemaining()) {
char c = src.get();
if (Character.isSurrogate(c)) {
if (sgp.parse(c, src) < 0)
return sgp.error();
return sgp.unmappableResult();
}
int outputSize = encodeSingle(c, outputByte);
if (outputSize == 0) { // DoubleByte
int ncode = encodeDouble(c);
if (ncode != 0 ) {
if ((ncode & 0xFF0000) == 0) {
outputByte[0] = (byte) ((ncode & 0xff00) >> 8);
outputByte[1] = (byte) (ncode & 0xff);
outputSize = 2;
}
} else {
return CoderResult.unmappableForLength(1);
}
}
if (dst.remaining() < outputSize)
return CoderResult.OVERFLOW;
// Put the byte in the output buffer
for (int i = 0; i < outputSize; i++) {
dst.put(outputByte[i]);
}
mark++;
}
return CoderResult.UNDERFLOW;
} finally {
src.position(mark);
}
}
protected CoderResult encodeLoop(CharBuffer src,
ByteBuffer dst)
{
if (src.hasArray() && dst.hasArray())
return encodeArrayLoop(src, dst);
else
return encodeBufferLoop(src, dst);
super(cs, 2.0f, 2.0f, ENC0201, ENC0208, null);
}
}
}

View File

@ -23,9 +23,6 @@
* questions.
*/
/*
*/
package sun.nio.cs.ext;
import java.nio.ByteBuffer;
@ -35,7 +32,7 @@ import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import sun.nio.cs.HistoricallyNamedCharset;
import sun.nio.cs.Surrogate;
import static sun.nio.cs.CharsetMapping.*;
public class EUC_JP_Open
extends Charset
@ -60,118 +57,55 @@ public class EUC_JP_Open
}
public CharsetEncoder newEncoder() {
// Need to force the replacement byte to 0x3f
// because JIS_X_0208_Encoder defines its own
// alternative 2 byte substitution to permit it
// to exist as a self-standing Encoder
byte[] replacementBytes = { (byte)0x3f };
return new Encoder(this).replaceWith(replacementBytes);
return new Encoder(this);
}
private static class Decoder extends EUC_JP.Decoder {
JIS_X_0201.Decoder decoderJ0201;
JIS_X_0212_Solaris_Decoder decodeMappingJ0212;
JIS_X_0208_Solaris_Decoder decodeMappingJ0208;
private static final short[] j0208Index1 =
JIS_X_0208_Solaris_Decoder.getIndex1();
private static final String[] j0208Index2 =
JIS_X_0208_Solaris_Decoder.getIndex2();
private static final int start = 0xa1;
private static final int end = 0xfe;
protected final char REPLACE_CHAR='\uFFFD';
private static DoubleByte.Decoder DEC0208_Solaris =
(DoubleByte.Decoder)new JIS_X_0208_Solaris().newDecoder();
private static DoubleByte.Decoder DEC0212_Solaris =
(DoubleByte.Decoder)new JIS_X_0212_Solaris().newDecoder();
private Decoder(Charset cs) {
super(cs);
decoderJ0201 = new JIS_X_0201.Decoder(cs);
decodeMappingJ0212 = new JIS_X_0212_Solaris_Decoder(cs);
}
protected char decode0212(int byte1, int byte2) {
return decodeMappingJ0212.decodeDouble(byte1, byte2);
// JIS_X_0208_Solaris only has the "extra" mappings, it
// does not have the JIS_X_0208 entries
super(cs, 0.5f, 1.0f, DEC0201, DEC0208, DEC0212_Solaris);
}
protected char decodeDouble(int byte1, int byte2) {
if (byte1 == 0x8e) {
return decoderJ0201.decode(byte2 - 256);
}
if (((byte1 < 0)
|| (byte1 > j0208Index1.length))
|| ((byte2 < start)
|| (byte2 > end)))
return REPLACE_CHAR;
char result = super.decodeDouble(byte1, byte2);
if (result != '\uFFFD') {
return result;
} else {
int n = (j0208Index1[byte1 - 0x80] & 0xf) *
(end - start + 1)
+ (byte2 - start);
return j0208Index2[j0208Index1[byte1 - 0x80] >> 4].charAt(n);
}
char c = super.decodeDouble(byte1, byte2);
if (c == UNMAPPABLE_DECODING)
return DEC0208_Solaris.decodeDouble(byte1 - 0x80, byte2 - 0x80);
return c;
}
}
private static class Encoder extends EUC_JP.Encoder {
private static DoubleByte.Encoder ENC0208_Solaris =
(DoubleByte.Encoder)new JIS_X_0208_Solaris().newEncoder();
JIS_X_0201.Encoder encoderJ0201;
JIS_X_0212_Solaris_Encoder encoderJ0212;
private static final short[] j0208Index1 =
JIS_X_0208_Solaris_Encoder.getIndex1();
private static final String[] j0208Index2 =
JIS_X_0208_Solaris_Encoder.getIndex2();
private final Surrogate.Parser sgp = new Surrogate.Parser();
private static DoubleByte.Encoder ENC0212_Solaris =
(DoubleByte.Encoder)new JIS_X_0212_Solaris().newEncoder();
private Encoder(Charset cs) {
// The EUC_JP_Open has some interesting tweak for the
// encoding, so can't just pass the euc0208_solaris to
// the euc_jp. Have to override the encodeDouble() as
// showed below (mapping testing catches this).
// super(cs, 3.0f, 3.0f, ENC0201, ENC0208_Solaris, ENC0212_Solaris);
super(cs);
encoderJ0201 = new JIS_X_0201.Encoder(cs);
encoderJ0212 = new JIS_X_0212_Solaris_Encoder(cs);
}
protected int encodeSingle(char inputChar, byte[] outputByte) {
byte b;
if (inputChar == 0) {
outputByte[0] = (byte)0;
return 1;
}
if ((b = encoderJ0201.encode(inputChar)) == 0)
return 0;
if (b > 0 && b < 128) {
outputByte[0] = b;
return 1;
}
outputByte[0] = (byte)0x8e;
outputByte[1] = b;
return 2;
}
protected int encodeDouble(char ch) {
int r = super.encodeDouble(ch);
if (r != 0) {
return r;
int b = super.encodeDouble(ch);
if (b != UNMAPPABLE_ENCODING)
return b;
b = ENC0208_Solaris.encodeChar(ch);
if (b != UNMAPPABLE_ENCODING && b > 0x7500) {
return 0x8F8080 + ENC0212_Solaris.encodeChar(ch);
}
else {
int offset = j0208Index1[((ch & 0xff00) >> 8 )] << 8;
r = j0208Index2[offset >> 12].charAt((offset & 0xfff) +
(ch & 0xFF));
if (r > 0x7500)
return 0x8F8080 + encoderJ0212.encodeDouble(ch);
}
return (r==0 ? 0: r + 0x8080);
return b == UNMAPPABLE_ENCODING ? b : b + 0x8080;
}
}
}

View File

@ -49,8 +49,8 @@ public class IBM834 extends Charset
public CharsetDecoder newDecoder() {
IBM933.initb2c();
return new DoubleByte.Decoder_EBCDIC_DBCSONLY(
this, IBM933.b2c, 0x40, 0xfe); // hardcode the b2min/max
return new DoubleByte.Decoder_DBCSONLY(
this, IBM933.b2c, null, 0x40, 0xfe); // hardcode the b2min/max
}
public CharsetEncoder newEncoder() {
@ -58,7 +58,7 @@ public class IBM834 extends Charset
return new Encoder(this);
}
protected static class Encoder extends DoubleByte.Encoder_EBCDIC_DBCSONLY {
protected static class Encoder extends DoubleByte.Encoder_DBCSONLY {
public Encoder(Charset cs) {
super(cs, new byte[] {(byte)0xfe, (byte)0xfe},
IBM933.c2b, IBM933.c2bIndex);

View File

@ -35,6 +35,7 @@ import java.nio.charset.CodingErrorAction;
import sun.nio.cs.HistoricallyNamedCharset;
import sun.nio.cs.Surrogate;
import sun.nio.cs.US_ASCII;
import static sun.nio.cs.CharsetMapping.*;
/*
* Implementation notes:
@ -154,71 +155,41 @@ public class ISO2022_JP
}
public CharsetDecoder newDecoder() {
return new Decoder(this,
getDecIndex1(),
getDecIndex2(),
get0212Decoder());
return new Decoder(this);
}
public CharsetEncoder newEncoder() {
return new Encoder(this,
getEncIndex1(),
getEncIndex2(),
get0212Encoder(),
doSBKANA());
}
protected short[] getDecIndex1() {
return JIS_X_0208_Decoder.getIndex1();
}
protected String[] getDecIndex2() {
return JIS_X_0208_Decoder.getIndex2();
}
protected DoubleByteDecoder get0212Decoder() {
return null;
}
protected short[] getEncIndex1() {
return JIS_X_0208_Encoder.getIndex1();
}
protected String[] getEncIndex2() {
return JIS_X_0208_Encoder.getIndex2();
}
protected DoubleByteEncoder get0212Encoder() {
return null;
return new Encoder(this);
}
protected boolean doSBKANA() {
return true;
}
private static class Decoder extends DoubleByteDecoder
static class Decoder extends CharsetDecoder
implements DelegatableDecoder {
final static DoubleByte.Decoder DEC0208 =
(DoubleByte.Decoder)new JIS_X_0208().newDecoder();
private int currentState;
private int previousState;
private DoubleByteDecoder decoder0212;
protected Decoder(Charset cs,
short[] index1,
String[] index2,
DoubleByteDecoder decoder0212) {
super(cs,
index1,
index2,
0x21,
0x7e);
this.decoder0212 = decoder0212;
currentState = ASCII;
previousState = ASCII;
private DoubleByte.Decoder dec0208;
private DoubleByte.Decoder dec0212;
private Decoder(Charset cs) {
this(cs, DEC0208, null);
}
protected char convSingleByte(int b) {
return REPLACE_CHAR;
protected Decoder(Charset cs,
DoubleByte.Decoder dec0208,
DoubleByte.Decoder dec0212) {
super(cs, 0.5f, 1.0f);
this.dec0208 = dec0208;
this.dec0212 = dec0212;
currentState = ASCII;
previousState = ASCII;
}
public void implReset() {
@ -231,7 +202,7 @@ public class ISO2022_JP
{
int inputSize = 0;
int b1 = 0, b2 = 0, b3 = 0, b4 = 0;
char c = REPLACE_CHAR;
char c = UNMAPPABLE_DECODING;
byte[] sa = src.array();
int sp = src.arrayOffset() + src.position();
int sl = src.arrayOffset() + src.limit();
@ -273,7 +244,7 @@ public class ISO2022_JP
currentState = JISX0208_1978;
} else if (b3 == 'B'){
currentState = JISX0208_1983;
} else if (b3 == '(' && decoder0212 != null) {
} else if (b3 == '(' && dec0212 != null) {
if (sp + inputSize + 1 > sl)
return CoderResult.UNDERFLOW;
b4 = sa[sp + inputSize++] & 0xff;
@ -322,8 +293,8 @@ public class ISO2022_JP
if (sp + inputSize + 1 > sl)
return CoderResult.UNDERFLOW;
b2 = sa[sp + inputSize++] & 0xff;
c = decodeDouble(b1,b2);
if (c == REPLACE_CHAR)
c = dec0208.decodeDouble(b1,b2);
if (c == UNMAPPABLE_DECODING)
return CoderResult.unmappableForLength(inputSize);
da[dp++] = c;
break;
@ -331,8 +302,8 @@ public class ISO2022_JP
if (sp + inputSize + 1 > sl)
return CoderResult.UNDERFLOW;
b2 = sa[sp + inputSize++] & 0xff;
c = decoder0212.decodeDouble(b1,b2);
if (c == REPLACE_CHAR)
c = dec0212.decodeDouble(b1,b2);
if (c == UNMAPPABLE_DECODING)
return CoderResult.unmappableForLength(inputSize);
da[dp++] = c;
break;
@ -358,7 +329,7 @@ public class ISO2022_JP
{
int mark = src.position();
int b1 = 0, b2 = 0, b3 = 0, b4=0;
char c = REPLACE_CHAR;
char c = UNMAPPABLE_DECODING;
int inputSize = 0;
try {
while (src.hasRemaining()) {
@ -391,7 +362,7 @@ public class ISO2022_JP
currentState = JISX0208_1978;
} else if (b3 == 'B'){
currentState = JISX0208_1983;
} else if (b3 == '(' && decoder0212 != null) {
} else if (b3 == '(' && dec0212 != null) {
if (!src.hasRemaining())
return CoderResult.UNDERFLOW;
b4 = src.get() & 0xff;
@ -442,8 +413,8 @@ public class ISO2022_JP
return CoderResult.UNDERFLOW;
b2 = src.get() & 0xff;
inputSize++;
c = decodeDouble(b1,b2);
if (c == REPLACE_CHAR)
c = dec0208.decodeDouble(b1,b2);
if (c == UNMAPPABLE_DECODING)
return CoderResult.unmappableForLength(inputSize);
dst.put(c);
break;
@ -452,8 +423,8 @@ public class ISO2022_JP
return CoderResult.UNDERFLOW;
b2 = src.get() & 0xff;
inputSize++;
c = decoder0212.decodeDouble(b1,b2);
if (c == REPLACE_CHAR)
c = dec0212.decodeDouble(b1,b2);
if (c == UNMAPPABLE_DECODING)
return CoderResult.unmappableForLength(inputSize);
dst.put(c);
break;
@ -486,25 +457,29 @@ public class ISO2022_JP
}
}
private static class Encoder extends DoubleByteEncoder {
static class Encoder extends CharsetEncoder {
final static DoubleByte.Encoder ENC0208 =
(DoubleByte.Encoder)new JIS_X_0208().newEncoder();
private static byte[] repl = { (byte)0x21, (byte)0x29 };
private int currentMode = ASCII;
private int replaceMode = JISX0208_1983;
private DoubleByteEncoder encoder0212 = null;
private DoubleByte.Encoder enc0208;
private DoubleByte.Encoder enc0212;
private boolean doSBKANA;
private Encoder(Charset cs,
short[] index1,
String[] index2,
DoubleByteEncoder encoder0212,
boolean doSBKANA) {
super(cs,
index1,
index2,
repl,
4.0f,
(encoder0212 != null)? 9.0f : 8.0f);
this.encoder0212 = encoder0212;
private Encoder(Charset cs) {
this(cs, ENC0208, null, true);
}
Encoder(Charset cs,
DoubleByte.Encoder enc0208,
DoubleByte.Encoder enc0212,
boolean doSBKANA) {
super(cs, 4.0f, (enc0212 != null)? 9.0f : 8.0f, repl);
this.enc0208 = enc0208;
this.enc0212 = enc0212;
this.doSBKANA = doSBKANA;
}
@ -545,8 +520,8 @@ public class ISO2022_JP
(c >= 0xFF61 && c <= 0xFF9F) ||
(c == '\u00A5') ||
(c == '\u203E') ||
super.canEncode(c) ||
(encoder0212!=null && encoder0212.canEncode(c)));
enc0208.canEncode(c) ||
(enc0212!=null && enc0212.canEncode(c)));
}
private final Surrogate.Parser sgp = new Surrogate.Parser();
@ -607,8 +582,8 @@ public class ISO2022_JP
return CoderResult.OVERFLOW;
da[dp++] = (c == '\u00A5')?(byte)0x5C:(byte)0x7e;
} else {
int index = encodeDouble(c);
if (index != 0) {
int index = enc0208.encodeChar(c);
if (index != UNMAPPABLE_ENCODING) {
if (currentMode != JISX0208_1983) {
if (dl - dp < 3)
return CoderResult.OVERFLOW;
@ -621,8 +596,8 @@ public class ISO2022_JP
return CoderResult.OVERFLOW;
da[dp++] = (byte)(index >> 8);
da[dp++] = (byte)(index & 0xff);
} else if (encoder0212 != null &&
(index = encoder0212.encodeDouble(c)) != 0) {
} else if (enc0212 != null &&
(index = enc0212.encodeChar(c)) != UNMAPPABLE_ENCODING) {
if (currentMode != JISX0212_1990) {
if (dl - dp < 4)
return CoderResult.OVERFLOW;
@ -715,8 +690,8 @@ public class ISO2022_JP
return CoderResult.OVERFLOW;
dst.put((c == '\u00A5')?(byte)0x5C:(byte)0x7e);
} else {
int index = encodeDouble(c);
if (index != 0) {
int index = enc0208.encodeChar(c);
if (index != UNMAPPABLE_ENCODING) {
if (currentMode != JISX0208_1983) {
if (dst.remaining() < 3)
return CoderResult.OVERFLOW;
@ -729,8 +704,8 @@ public class ISO2022_JP
return CoderResult.OVERFLOW;
dst.put((byte)(index >> 8));
dst.put((byte)(index & 0xff));
} else if (encoder0212 != null &&
(index = encoder0212.encodeDouble(c)) != 0) {
} else if (enc0212 != null &&
(index = enc0212.encodeChar(c)) != UNMAPPABLE_ENCODING) {
if (currentMode != JISX0212_1990) {
if (dst.remaining() < 4)
return CoderResult.OVERFLOW;

View File

@ -26,6 +26,8 @@
package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
public class ISO2022_JP_2 extends ISO2022_JP
{
@ -44,12 +46,18 @@ public class ISO2022_JP_2 extends ISO2022_JP
(cs instanceof ISO2022_JP_2);
}
protected DoubleByteDecoder get0212Decoder() {
return new JIS_X_0212_Decoder(this);
public CharsetDecoder newDecoder() {
return new Decoder(this, Decoder.DEC0208, DEC0212);
}
protected DoubleByteEncoder get0212Encoder() {
return new JIS_X_0212_Encoder(this);
public CharsetEncoder newEncoder() {
return new Encoder(this, Encoder.ENC0208, ENC0212, true);
}
private final static DoubleByte.Decoder DEC0212 =
(DoubleByte.Decoder)new JIS_X_0212().newDecoder();
private final static DoubleByte.Encoder ENC0212 =
(DoubleByte.Encoder)new JIS_X_0212().newEncoder();
}

View File

@ -1,232 +0,0 @@
/*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
class JIS_X_0212_MS5022X_Decoder extends JIS_X_0212_Decoder
{
private int _start, _end;
public JIS_X_0212_MS5022X_Decoder(Charset cs) {
super(cs);
_start = 0x21;
_end = 0x7E;
}
protected char decodeDouble(int byte1, int byte2) {
if (((byte1 < 0) || (byte1 > _index1.length))
|| ((byte2 < _start) || (byte2 > _end)))
return REPLACE_CHAR;
int n = (_index1[byte1] & 0xf)*(_end - _start + 1) + (byte2 - _start);
char unicode = _index2[_index1[byte1] >> 4].charAt(n);
if (unicode == '\u0000')
return (super.decodeDouble(byte1, byte2));
else
return unicode;
}
private final static String _innerIndex0=
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u2170\u2171"+
"\u2172\u2173\u2174\u2175\u2176\u2177\u2178\u2179"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\uFF07\uFF02\u0000\u0000\u0000\u70BB"+
"\u4EFC\u50F4\u51EC\u5307\u5324\uFA0E\u548A\u5759"+
"\uFA0F\uFA10\u589E\u5BEC\u5CF5\u5D53\uFA11\u5FB7"+
"\u6085\u6120\u654E\u0000\u6665\uFA12\uF929\u6801"+
"\uFA13\uFA14\u6A6B\u6AE2\u6DF8\u6DF2\u7028\uFA15"+
"\uFA16\u7501\u7682\u769E\uFA17\u7930\uFA18\uFA19"+
"\uFA1A\uFA1B\u7AE7\uFA1C\uFA1D\u7DA0\u7DD6\uFA1E"+
"\u8362\uFA1F\u85B0\uFA20\uFA21\u8807\uFA22\u8B7F"+
"\u8CF4\u8D76\uFA23\uFA24\uFA25\u90DE\uFA26\u9115"+
"\uFA27\uFA28\u9592\uF9DC\uFA29\u973B\u0000\u9751"+
"\uFA2A\uFA2B\uFA2C\u999E\u9AD9\u9B72\uFA2D\u9ED1"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u974D\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\uE3AC\uE3AD\uE3AE\uE3AF\uE3B0\uE3B1"+
"\uE3B2\uE3B3\uE3B4\uE3B5\uE3B6\uE3B7\uE3B8\uE3B9"+
"\uE3BA\uE3BB\uE3BC\uE3BD\uE3BE\uE3BF\uE3C0\uE3C1"+
"\uE3C2\uE3C3\uE3C4\uE3C5\uE3C6\uE3C7\uE3C8\uE3C9"+
"\uE3CA\uE3CB\uE3CC\uE3CD\uE3CE\uE3CF\uE3D0\uE3D1"+
"\uE3D2\uE3D3\uE3D4\uE3D5\uE3D6\uE3D7\uE3D8\uE3D9"+
"\uE3DA\uE3DB\uE3DC\uE3DD\uE3DE\uE3DF\uE3E0\uE3E1"+
"\uE3E2\uE3E3\uE3E4\uE3E5\uE3E6\uE3E7\uE3E8\uE3E9"+
"\uE3EA\uE3EB\uE3EC\uE3ED\uE3EE\uE3EF\uE3F0\uE3F1"+
"\uE3F2\uE3F3\uE3F4\uE3F5\uE3F6\uE3F7\uE3F8\uE3F9"+
"\uE3FA\uE3FB\uE3FC\uE3FD\uE3FE\uE3FF\uE400\uE401"+
"\uE402\uE403\uE404\uE405\uE406\uE407\uE408\uE409"+
"\uE40A\uE40B\uE40C\uE40D\uE40E\uE40F\uE410\uE411"+
"\uE412\uE413\uE414\uE415\uE416\uE417\uE418\uE419"+
"\uE41A\uE41B\uE41C\uE41D\uE41E\uE41F\uE420\uE421"+
"\uE422\uE423\uE424\uE425\uE426\uE427\uE428\uE429"+
"\uE42A\uE42B\uE42C\uE42D\uE42E\uE42F\uE430\uE431"+
"\uE432\uE433\uE434\uE435\uE436\uE437\uE438\uE439"+
"\uE43A\uE43B\uE43C\uE43D\uE43E\uE43F\uE440\uE441"+
"\uE442\uE443\uE444\uE445\uE446\uE447\uE448\uE449"+
"\uE44A\uE44B\uE44C\uE44D\uE44E\uE44F\uE450\uE451"+
"\uE452\uE453\uE454\uE455\uE456\uE457\uE458\uE459"+
"\uE45A\uE45B\uE45C\uE45D\uE45E\uE45F\uE460\uE461"+
"\uE462\uE463\uE464\uE465\uE466\uE467\uE468\uE469"+
"\uE46A\uE46B\uE46C\uE46D\uE46E\uE46F\uE470\uE471"+
"\uE472\uE473\uE474\uE475\uE476\uE477\uE478\uE479"+
"\uE47A\uE47B\uE47C\uE47D\uE47E\uE47F\uE480\uE481"+
"\uE482\uE483\uE484\uE485\uE486\uE487\uE488\uE489"+
"\uE48A\uE48B\uE48C\uE48D\uE48E\uE48F\uE490\uE491"+
"\uE492\uE493\uE494\uE495\uE496\uE497\uE498\uE499"+
"\uE49A\uE49B\uE49C\uE49D\uE49E\uE49F\uE4A0\uE4A1"+
"\uE4A2\uE4A3\uE4A4\uE4A5\uE4A6\uE4A7\uE4A8\uE4A9"+
"\uE4AA\uE4AB\uE4AC\uE4AD\uE4AE\uE4AF\uE4B0\uE4B1"+
"\uE4B2\uE4B3\uE4B4\uE4B5\uE4B6\uE4B7\uE4B8\uE4B9"+
"\uE4BA\uE4BB\uE4BC\uE4BD\uE4BE\uE4BF\uE4C0\uE4C1"+
"\uE4C2\uE4C3\uE4C4\uE4C5\uE4C6\uE4C7\uE4C8\uE4C9"+
"\uE4CA\uE4CB\uE4CC\uE4CD\uE4CE\uE4CF\uE4D0\uE4D1"+
"\uE4D2\uE4D3\uE4D4\uE4D5\uE4D6\uE4D7\uE4D8\uE4D9"+
"\uE4DA\uE4DB\uE4DC\uE4DD\uE4DE\uE4DF\uE4E0\uE4E1"+
"\uE4E2\uE4E3\uE4E4\uE4E5\uE4E6\uE4E7\uE4E8\uE4E9"+
"\uE4EA\uE4EB\uE4EC\uE4ED\uE4EE\uE4EF\uE4F0\uE4F1"+
"\uE4F2\uE4F3\uE4F4\uE4F5\uE4F6\uE4F7\uE4F8\uE4F9"+
"\uE4FA\uE4FB\uE4FC\uE4FD\uE4FE\uE4FF\uE500\uE501"+
"\uE502\uE503\uE504\uE505\uE506\uE507\uE508\uE509"+
"\uE50A\uE50B\uE50C\uE50D\uE50E\uE50F\uE510\uE511"+
"\uE512\uE513\uE514\uE515\uE516\uE517\uE518\uE519"+
"\uE51A\uE51B\uE51C\uE51D\uE51E\uE51F\uE520\uE521"+
"\uE522\uE523\uE524\uE525\uE526\uE527\uE528\uE529"+
"\uE52A\uE52B\uE52C\uE52D\uE52E\uE52F\uE530\uE531"+
"\uE532\uE533\uE534\uE535\uE536\uE537\uE538\uE539"+
"\uE53A\uE53B\uE53C\uE53D\uE53E\uE53F\uE540\uE541"+
"\uE542\uE543\uE544\uE545\uE546\uE547\uE548\uE549"+
"\uE54A\uE54B\uE54C\uE54D\uE54E\uE54F\uE550\uE551"+
"\uE552\uE553\uE554\uE555\uE556\uE557\uE558\uE559"+
"\uE55A\uE55B\uE55C\uE55D\uE55E\uE55F\uE560\uE561"+
"\uE562\uE563\uE564\uE565\uE566\uE567\uE568\uE569"+
"\uE56A\uE56B\uE56C\uE56D\uE56E\uE56F\uE570\uE571"+
"\uE572\uE573\uE574\uE575\uE576\uE577\uE578\uE579"+
"\uE57A\uE57B\uE57C\uE57D\uE57E\uE57F\uE580\uE581"+
"\uE582\uE583\uE584\uE585\uE586\uE587\uE588\uE589"+
"\uE58A\uE58B\uE58C\uE58D\uE58E\uE58F\uE590\uE591"+
"\uE592\uE593\uE594\uE595\uE596\uE597\uE598\uE599"+
"\uE59A\uE59B\uE59C\uE59D\uE59E\uE59F\uE5A0\uE5A1"+
"\uE5A2\uE5A3\uE5A4\uE5A5\uE5A6\uE5A7\uE5A8\uE5A9"+
"\uE5AA\uE5AB\uE5AC\uE5AD\uE5AE\uE5AF\uE5B0\uE5B1"+
"\uE5B2\uE5B3\uE5B4\uE5B5\uE5B6\uE5B7\uE5B8\uE5B9"+
"\uE5BA\uE5BB\uE5BC\uE5BD\uE5BE\uE5BF\uE5C0\uE5C1"+
"\uE5C2\uE5C3\uE5C4\uE5C5\uE5C6\uE5C7\uE5C8\uE5C9"+
"\uE5CA\uE5CB\uE5CC\uE5CD\uE5CE\uE5CF\uE5D0\uE5D1"+
"\uE5D2\uE5D3\uE5D4\uE5D5\uE5D6\uE5D7\uE5D8\uE5D9"+
"\uE5DA\uE5DB\uE5DC\uE5DD\uE5DE\uE5DF\uE5E0\uE5E1"+
"\uE5E2\uE5E3\uE5E4\uE5E5\uE5E6\uE5E7\uE5E8\uE5E9"+
"\uE5EA\uE5EB\uE5EC\uE5ED\uE5EE\uE5EF\uE5F0\uE5F1"+
"\uE5F2\uE5F3\uE5F4\uE5F5\uE5F6\uE5F7\uE5F8\uE5F9"+
"\uE5FA\uE5FB\uE5FC\uE5FD\uE5FE\uE5FF\uE600\uE601"+
"\uE602\uE603\uE604\uE605\uE606\uE607\uE608\uE609"+
"\uE60A\uE60B\uE60C\uE60D\uE60E\uE60F\uE610\uE611"+
"\uE612\uE613\uE614\uE615\uE616\uE617\uE618\uE619"+
"\uE61A\uE61B\uE61C\uE61D\uE61E\uE61F\uE620\uE621"+
"\uE622\uE623\uE624\uE625\uE626\uE627\uE628\uE629"+
"\uE62A\uE62B\uE62C\uE62D\uE62E\uE62F\uE630\uE631"+
"\uE632\uE633\uE634\uE635\uE636\uE637\uE638\uE639"+
"\uE63A\uE63B\uE63C\uE63D\uE63E\uE63F\uE640\uE641"+
"\uE642\uE643\uE644\uE645\uE646\uE647\uE648\uE649"+
"\uE64A\uE64B\uE64C\uE64D\uE64E\uE64F\uE650\uE651"+
"\uE652\uE653\uE654\uE655\uE656\uE657\uE658\uE659"+
"\uE65A\uE65B\uE65C\uE65D\uE65E\uE65F\uE660\uE661"+
"\uE662\uE663\uE664\uE665\uE666\uE667\uE668\uE669"+
"\uE66A\uE66B\uE66C\uE66D\uE66E\uE66F\uE670\uE671"+
"\uE672\uE673\uE674\uE675\uE676\uE677\uE678\uE679"+
"\uE67A\uE67B\uE67C\uE67D\uE67E\uE67F\uE680\uE681"+
"\uE682\uE683\uE684\uE685\uE686\uE687\uE688\uE689"+
"\uE68A\uE68B\uE68C\uE68D\uE68E\uE68F\uE690\uE691"+
"\uE692\uE693\uE694\uE695\uE696\uE697\uE698\uE699"+
"\uE69A\uE69B\uE69C\uE69D\uE69E\uE69F\uE6A0\uE6A1"+
"\uE6A2\uE6A3\uE6A4\uE6A5\uE6A6\uE6A7\uE6A8\uE6A9"+
"\uE6AA\uE6AB\uE6AC\uE6AD\uE6AE\uE6AF\uE6B0\uE6B1"+
"\uE6B2\uE6B3\uE6B4\uE6B5\uE6B6\uE6B7\uE6B8\uE6B9"+
"\uE6BA\uE6BB\uE6BC\uE6BD\uE6BE\uE6BF\uE6C0\uE6C1"+
"\uE6C2\uE6C3\uE6C4\uE6C5\uE6C6\uE6C7\uE6C8\uE6C9"+
"\uE6CA\uE6CB\uE6CC\uE6CD\uE6CE\uE6CF\uE6D0\uE6D1"+
"\uE6D2\uE6D3\uE6D4\uE6D5\uE6D6\uE6D7\uE6D8\uE6D9"+
"\uE6DA\uE6DB\uE6DC\uE6DD\uE6DE\uE6DF\uE6E0\uE6E1"+
"\uE6E2\uE6E3\uE6E4\uE6E5\uE6E6\uE6E7\uE6E8\uE6E9"+
"\uE6EA\uE6EB\uE6EC\uE6ED\uE6EE\uE6EF\uE6F0\uE6F1"+
"\uE6F2\uE6F3\uE6F4\uE6F5\uE6F6\uE6F7\uE6F8\uE6F9"+
"\uE6FA\uE6FB\uE6FC\uE6FD\uE6FE\uE6FF\uE700\uE701"+
"\uE702\uE703\uE704\uE705\uE706\uE707\uE708\uE709"+
"\uE70A\uE70B\uE70C\uE70D\uE70E\uE70F\uE710\uE711"+
"\uE712\uE713\uE714\uE715\uE716\uE717\uE718\uE719"+
"\uE71A\uE71B\uE71C\uE71D\uE71E\uE71F\uE720\uE721"+
"\uE722\uE723\uE724\uE725\uE726\uE727\uE728\uE729"+
"\uE72A\uE72B\uE72C\uE72D\uE72E\uE72F\uE730\uE731"+
"\uE732\uE733\uE734\uE735\uE736\uE737\uE738\uE739"+
"\uE73A\uE73B\uE73C\uE73D\uE73E\uE73F\uE740\uE741"+
"\uE742\uE743\uE744\uE745\uE746\uE747\uE748\uE749"+
"\uE74A\uE74B\uE74C\uE74D\uE74E\uE74F\uE750\uE751"+
"\uE752\uE753\uE754\uE755\uE756\uE757";
private final static short _index1[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
private final static String _index2[] = {
_innerIndex0
};
}

View File

@ -26,6 +26,8 @@
package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
public class MS50220 extends ISO2022_JP
{
@ -34,6 +36,10 @@ public class MS50220 extends ISO2022_JP
ExtendedCharsets.aliasesFor("x-windows-50220"));
}
protected MS50220(String canonicalName, String[] aliases) {
super(canonicalName, aliases);
}
public String historicalName() {
return "MS50220";
}
@ -44,29 +50,25 @@ public class MS50220 extends ISO2022_JP
(cs instanceof MS50220);
}
protected short[] getDecIndex1() {
return JIS_X_0208_MS5022X_Decoder.index1;
public CharsetDecoder newDecoder() {
return new Decoder(this, DEC0208, DEC0212);
}
protected String[] getDecIndex2() {
return JIS_X_0208_MS5022X_Decoder.index2;
public CharsetEncoder newEncoder() {
return new Encoder(this, ENC0208, ENC0212, doSBKANA());
}
protected DoubleByteDecoder get0212Decoder() {
return new JIS_X_0212_MS5022X_Decoder(this);
}
private final static DoubleByte.Decoder DEC0208 =
(DoubleByte.Decoder)new JIS_X_0208_MS5022X().newDecoder();
protected short[] getEncIndex1() {
return JIS_X_0208_MS5022X_Encoder.index1;
}
private final static DoubleByte.Decoder DEC0212 =
(DoubleByte.Decoder)new JIS_X_0212_MS5022X().newDecoder();
protected String[] getEncIndex2() {
return JIS_X_0208_MS5022X_Encoder.index2;
}
private final static DoubleByte.Encoder ENC0208 =
(DoubleByte.Encoder)new JIS_X_0208_MS5022X().newEncoder();
protected DoubleByteEncoder get0212Encoder() {
return new JIS_X_0212_MS5022X_Encoder(this);
}
private final static DoubleByte.Encoder ENC0212 =
(DoubleByte.Encoder)new JIS_X_0212_MS5022X().newEncoder();
protected boolean doSBKANA() {
return false;

View File

@ -27,7 +27,7 @@ package sun.nio.cs.ext;
import java.nio.charset.Charset;
public class MS50221 extends ISO2022_JP
public class MS50221 extends MS50220
{
public MS50221() {
super("x-windows-50221",
@ -44,30 +44,6 @@ public class MS50221 extends ISO2022_JP
(cs instanceof MS50221);
}
protected short[] getDecIndex1() {
return JIS_X_0208_MS5022X_Decoder.index1;
}
protected String[] getDecIndex2() {
return JIS_X_0208_MS5022X_Decoder.index2;
}
protected DoubleByteDecoder get0212Decoder() {
return new JIS_X_0212_MS5022X_Decoder(this);
}
protected short[] getEncIndex1() {
return JIS_X_0208_MS5022X_Encoder.index1;
}
protected String[] getEncIndex2() {
return JIS_X_0208_MS5022X_Encoder.index2;
}
protected DoubleByteEncoder get0212Encoder() {
return new JIS_X_0212_MS5022X_Encoder(this);
}
protected boolean doSBKANA() {
return true;
}

View File

@ -26,6 +26,8 @@
package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
public class MSISO2022JP extends ISO2022_JP
{
@ -43,31 +45,17 @@ public class MSISO2022JP extends ISO2022_JP
(cs instanceof MSISO2022JP);
}
protected short[] getDecIndex1() {
return JIS_X_0208_MS932_Decoder.index1;
public CharsetDecoder newDecoder() {
return new Decoder(this, DEC0208, null);
}
protected String[] getDecIndex2() {
return JIS_X_0208_MS932_Decoder.index2;
public CharsetEncoder newEncoder() {
return new Encoder(this, ENC0208, null, true);
}
protected DoubleByteDecoder get0212Decoder() {
return null;
}
private final static DoubleByte.Decoder DEC0208 =
(DoubleByte.Decoder)new JIS_X_0208_MS932().newDecoder();
protected short[] getEncIndex1() {
return JIS_X_0208_MS932_Encoder.index1;
}
protected String[] getEncIndex2() {
return JIS_X_0208_MS932_Encoder.index2;
}
protected DoubleByteEncoder get0212Encoder() {
return null;
}
protected boolean doSBKANA() {
return true;
}
private final static DoubleByte.Encoder ENC0208 =
(DoubleByte.Encoder)new JIS_X_0208_MS932().newEncoder();
}

View File

@ -25,12 +25,19 @@
package sun.awt.motif;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CharsetDecoder;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.*;
import sun.nio.cs.*;
import sun.nio.cs.ext.JIS_X_0201;
import static sun.nio.cs.CharsetMapping.*;
public class X11JIS0201 extends Charset {
private static Charset jis0201 = new JIS_X_0201();
private static SingleByte.Encoder enc =
(SingleByte.Encoder)jis0201.newEncoder();
public X11JIS0201 () {
super("X11JIS0201", null);
}
@ -40,16 +47,17 @@ public class X11JIS0201 extends Charset {
}
public CharsetDecoder newDecoder() {
return new JIS_X_0201.Decoder(this);
return jis0201.newDecoder();
}
public boolean contains(Charset cs) {
return cs instanceof X11JIS0201;
}
private class Encoder extends JIS_X_0201.Encoder {
private class Encoder extends CharsetEncoder {
public Encoder(Charset cs) {
super(cs);
super(cs, 1.0f, 1.0f);
}
public boolean canEncode(char c){
@ -60,5 +68,42 @@ public class X11JIS0201 extends Charset {
}
return false;
}
private Surrogate.Parser sgp;
protected CoderResult encodeLoop(CharBuffer src, ByteBuffer dst) {
char[] sa = src.array();
int sp = src.arrayOffset() + src.position();
int sl = src.arrayOffset() + src.limit();
byte[] da = dst.array();
int dp = dst.arrayOffset() + dst.position();
int dl = dst.arrayOffset() + dst.limit();
CoderResult cr = CoderResult.UNDERFLOW;
if ((dl - dp) < (sl - sp)) {
sl = sp + (dl - dp);
cr = CoderResult.OVERFLOW;
}
try {
while (sp < sl) {
char c = sa[sp];
int b = enc.encode(c);
if (b == UNMAPPABLE_ENCODING) {
if (Character.isSurrogate(c)) {
if (sgp == null)
sgp = new Surrogate.Parser();
if (sgp.parse(c, sa, sp, sl) >= 0)
return CoderResult.unmappableForLength(2);
}
return CoderResult.unmappableForLength(1);
}
da[dp++] = (byte)b;
sp++;
}
return cr;
} finally {
src.position(sp - src.arrayOffset());
dst.position(dp - dst.arrayOffset());
}
}
}
}

View File

@ -28,20 +28,22 @@ package sun.awt.motif;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CharsetDecoder;
import sun.nio.cs.ext.JIS_X_0208_Encoder;
import sun.nio.cs.ext.JIS_X_0208_Decoder;
import sun.nio.cs.ext.JIS_X_0208;
public class X11JIS0208 extends Charset {
private static Charset jis0208 = new JIS_X_0208();
public X11JIS0208 () {
super("X11JIS0208", null);
}
public CharsetEncoder newEncoder() {
return new JIS_X_0208_Encoder(this);
return jis0208.newEncoder();
}
public CharsetDecoder newDecoder() {
return new JIS_X_0208_Decoder(this);
return jis0208.newDecoder();
}
public boolean contains(Charset cs) {

View File

@ -28,20 +28,20 @@ package sun.awt.motif;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CharsetDecoder;
import sun.nio.cs.ext.JIS_X_0212_Encoder;
import sun.nio.cs.ext.JIS_X_0212_Decoder;
import sun.nio.cs.ext.JIS_X_0212;
public class X11JIS0212 extends Charset {
private static Charset jis0212 = new JIS_X_0212();
public X11JIS0212 () {
super("X11JIS0212", null);
}
public CharsetEncoder newEncoder() {
return new JIS_X_0212_Encoder(this);
return jis0212.newEncoder();
}
public CharsetDecoder newDecoder() {
return new JIS_X_0212_Decoder(this);
return jis0212.newDecoder();
}
public boolean contains(Charset cs) {
return cs instanceof X11JIS0212;
}

View File

@ -68,6 +68,11 @@ public class NIOCharsetAvailabilityTest {
charsets.remove(Class.forName("sun.nio.cs.ext.ISO2022"));
charsets.remove(Class.forName("sun.nio.cs.ext.ISO2022_CN_GB"));
charsets.remove(Class.forName("sun.nio.cs.ext.ISO2022_CN_CNS"));
charsets.remove(Class.forName("sun.nio.cs.ext.JIS_X_0208_Solaris"));
charsets.remove(Class.forName("sun.nio.cs.ext.JIS_X_0208_MS932"));
charsets.remove(Class.forName("sun.nio.cs.ext.JIS_X_0212_MS5022X"));
charsets.remove(Class.forName("sun.nio.cs.ext.JIS_X_0212_Solaris"));
charsets.remove(Class.forName("sun.nio.cs.ext.JIS_X_0208_MS5022X"));
// report the charsets that are implemented but not available
iter = charsets.iterator();

View File

@ -26,7 +26,6 @@
/*
*/
//package sun.nio.cs.ext;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;

View File

@ -26,7 +26,6 @@
/*
*/
//package sun.nio.cs.ext;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
@ -95,7 +94,7 @@ public abstract class DoubleByteEncoder
try {
while (sp < sl) {
char c = sa[sp];
if (Surrogate.is(c)) {
if (Character.isSurrogate(c)) {
if (sgp.parse(c, sa, sp, sl) < 0)
return sgp.error();
if (sl - sp < 2)
@ -153,7 +152,7 @@ public abstract class DoubleByteEncoder
try {
while (src.hasRemaining()) {
char c = src.get();
if (Surrogate.is(c)) {
if (Character.isSurrogate(c)) {
int surr;
if ((surr = sgp.parse(c, src)) < 0)
return sgp.error();

View File

@ -0,0 +1,367 @@
/*
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
*/
import java.nio.*;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import sun.nio.cs.HistoricallyNamedCharset;
import sun.nio.cs.Surrogate;
public class EUC_JP_LINUX_OLD
extends Charset
implements HistoricallyNamedCharset
{
public EUC_JP_LINUX_OLD() {
super("x-euc-jp-linux_OLD", null);
}
public String historicalName() {
return "EUC_JP_LINUX";
}
public boolean contains(Charset cs) {
return ((cs instanceof JIS_X_0201_OLD)
|| (cs.name().equals("US-ASCII"))
|| (cs instanceof EUC_JP_LINUX_OLD));
}
public CharsetDecoder newDecoder() {
return new Decoder(this);
}
public CharsetEncoder newEncoder() {
return new Encoder(this);
}
private static class Decoder extends CharsetDecoder {
JIS_X_0201_OLD.Decoder decoderJ0201;
protected final char REPLACE_CHAR='\uFFFD';
private static final int start = 0xa1;
private static final int end = 0xfe;
private static final short[] jis0208Index1 =
JIS_X_0208_Decoder.getIndex1();
private static final String[] jis0208Index2 =
JIS_X_0208_Decoder.getIndex2();
private Decoder(Charset cs) {
super(cs, 1.0f, 1.0f);
decoderJ0201 = new JIS_X_0201_OLD.Decoder(cs);
}
protected char convSingleByte(int b) {
if (b < 0 || b > 0x7f)
return REPLACE_CHAR;
return decoderJ0201.decode(b);
}
protected char decodeDouble(int byte1, int byte2) {
if (byte1 == 0x8e) {
return decoderJ0201.decode(byte2 - 256);
}
if (((byte1 < 0) || (byte1 > jis0208Index1.length))
|| ((byte2 < start) || (byte2 > end)))
return REPLACE_CHAR;
int n = (jis0208Index1[byte1 - 0x80] & 0xf) * (end - start + 1)
+ (byte2 - start);
return jis0208Index2[jis0208Index1[byte1 - 0x80] >> 4].charAt(n);
}
private CoderResult decodeArrayLoop(ByteBuffer src,
CharBuffer dst)
{
byte[] sa = src.array();
int sp = src.arrayOffset() + src.position();
int sl = src.arrayOffset() + src.limit();
assert (sp <= sl);
sp = (sp <= sl ? sp : sl);
char[] da = dst.array();
int dp = dst.arrayOffset() + dst.position();
int dl = dst.arrayOffset() + dst.limit();
assert (dp <= dl);
dp = (dp <= dl ? dp : dl);
int b1 = 0, b2 = 0;
int inputSize = 0;
char outputChar = REPLACE_CHAR; // U+FFFD;
try {
while (sp < sl) {
b1 = sa[sp] & 0xff;
inputSize = 1;
if ((b1 & 0x80) == 0) {
outputChar = (char)b1;
}
else { // Multibyte char
if ((b1 & 0xff) == 0x8f) { // JIS0212
if (sp + 3 > sl)
return CoderResult.UNDERFLOW;
inputSize = 3;
return CoderResult.unmappableForLength(inputSize); // substitute
} else {
// JIS0208
if (sp + 2 > sl)
return CoderResult.UNDERFLOW;
b2 = sa[sp + 1] & 0xff;
inputSize = 2;
outputChar = decodeDouble(b1, b2);
}
}
if (outputChar == REPLACE_CHAR) { // can't be decoded
return CoderResult.unmappableForLength(inputSize);
}
if (dp + 1 > dl)
return CoderResult.OVERFLOW;
da[dp++] = outputChar;
sp += inputSize;
}
return CoderResult.UNDERFLOW;
} finally {
src.position(sp - src.arrayOffset());
dst.position(dp - dst.arrayOffset());
}
}
private CoderResult decodeBufferLoop(ByteBuffer src,
CharBuffer dst)
{
int mark = src.position();
char outputChar = REPLACE_CHAR; // U+FFFD;
try {
while (src.hasRemaining()) {
int b1 = src.get() & 0xff;
int inputSize = 1;
if ((b1 & 0x80) == 0) {
outputChar = (char)b1;
} else { // Multibyte char
if ((b1 & 0xff) == 0x8f) { // JIS0212 not supported
if (src.remaining() < 2)
return CoderResult.UNDERFLOW;
return CoderResult.unmappableForLength(3);
} else {
// JIS0208
if (src.remaining() < 1)
return CoderResult.UNDERFLOW;
int b2 = src.get() & 0xff;
inputSize++;
outputChar = decodeDouble(b1, b2);
}
}
if (outputChar == REPLACE_CHAR)
return CoderResult.unmappableForLength(inputSize);
if (dst.remaining() < 1)
return CoderResult.OVERFLOW;
dst.put(outputChar);
mark += inputSize;
}
return CoderResult.UNDERFLOW;
} finally {
src.position(mark);
}
}
protected CoderResult decodeLoop(ByteBuffer src,
CharBuffer dst)
{
if (src.hasArray() && dst.hasArray())
return decodeArrayLoop(src, dst);
else
return decodeBufferLoop(src, dst);
}
}
private static class Encoder extends CharsetEncoder {
JIS_X_0201_OLD.Encoder encoderJ0201;
private final Surrogate.Parser sgp = new Surrogate.Parser();
private static final short[] jis0208Index1 =
JIS_X_0208_Encoder.getIndex1();
private static final String[] jis0208Index2 =
JIS_X_0208_Encoder.getIndex2();
private Encoder(Charset cs) {
super(cs, 2.0f, 2.0f);
encoderJ0201 = new JIS_X_0201_OLD.Encoder(cs);
}
public boolean canEncode(char c) {
byte[] encodedBytes = new byte[2];
if (encodeSingle(c, encodedBytes) == 0) { //doublebyte
if (encodeDouble(c) == 0)
return false;
}
return true;
}
protected int encodeSingle(char inputChar, byte[] outputByte) {
byte b;
if (inputChar == 0) {
outputByte[0] = (byte)0;
return 1;
}
if ((b = encoderJ0201.encode(inputChar)) == 0)
return 0;
if (b > 0 && b < 128) {
outputByte[0] = b;
return 1;
}
outputByte[0] = (byte)0x8e;
outputByte[1] = b;
return 2;
}
protected int encodeDouble(char ch) {
int offset = jis0208Index1[((ch & 0xff00) >> 8 )] << 8;
int r = jis0208Index2[offset >> 12].charAt((offset & 0xfff) + (ch & 0xff));
if (r != 0)
return r + 0x8080;
return r;
}
private CoderResult encodeArrayLoop(CharBuffer src,
ByteBuffer dst)
{
char[] sa = src.array();
int sp = src.arrayOffset() + src.position();
int sl = src.arrayOffset() + src.limit();
assert (sp <= sl);
sp = (sp <= sl ? sp : sl);
byte[] da = dst.array();
int dp = dst.arrayOffset() + dst.position();
int dl = dst.arrayOffset() + dst.limit();
assert (dp <= dl);
dp = (dp <= dl ? dp : dl);
final byte[] outputByte = new byte[2];
try {
while (sp < sl) {
char c = sa[sp];
if (Character.isSurrogate(c)) {
if (sgp.parse(c, sa, sp, sl) < 0)
return sgp.error();
return sgp.unmappableResult();
}
int outputSize = encodeSingle(c, outputByte);
if (outputSize == 0) { // DoubleByte
int ncode = encodeDouble(c);
if (ncode != 0 && ((ncode & 0xFF0000) == 0)) {
outputByte[0] = (byte) ((ncode & 0xff00) >> 8);
outputByte[1] = (byte) (ncode & 0xff);
outputSize = 2;
} else {
return CoderResult.unmappableForLength(1);
}
}
if (dl - dp < outputSize)
return CoderResult.OVERFLOW;
// Put the byte in the output buffer
for (int i = 0; i < outputSize; i++) {
da[dp++] = outputByte[i];
}
sp++;
}
return CoderResult.UNDERFLOW;
} finally {
src.position(sp - src.arrayOffset());
dst.position(dp - dst.arrayOffset());
}
}
private CoderResult encodeBufferLoop(CharBuffer src,
ByteBuffer dst)
{
final byte[] outputByte = new byte[4];
int mark = src.position();
try {
while (src.hasRemaining()) {
char c = src.get();
if (Character.isSurrogate(c)) {
if (sgp.parse(c, src) < 0)
return sgp.error();
return sgp.unmappableResult();
}
int outputSize = encodeSingle(c, outputByte);
if (outputSize == 0) { // DoubleByte
int ncode = encodeDouble(c);
if (ncode != 0 ) {
if ((ncode & 0xFF0000) == 0) {
outputByte[0] = (byte) ((ncode & 0xff00) >> 8);
outputByte[1] = (byte) (ncode & 0xff);
outputSize = 2;
}
} else {
return CoderResult.unmappableForLength(1);
}
}
if (dst.remaining() < outputSize)
return CoderResult.OVERFLOW;
// Put the byte in the output buffer
for (int i = 0; i < outputSize; i++) {
dst.put(outputByte[i]);
}
mark++;
}
return CoderResult.UNDERFLOW;
} finally {
src.position(mark);
}
}
protected CoderResult encodeLoop(CharBuffer src,
ByteBuffer dst)
{
if (src.hasArray() && dst.hasArray())
return encodeArrayLoop(src, dst);
else
return encodeBufferLoop(src, dst);
}
}
}

View File

@ -0,0 +1,420 @@
/*
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
*/
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import sun.nio.cs.HistoricallyNamedCharset;
import sun.nio.cs.Surrogate;
public class EUC_JP_OLD
extends Charset
implements HistoricallyNamedCharset
{
public EUC_JP_OLD() {
super("EUC-JP_OLD", null);
}
public String historicalName() {
return "EUC_JP";
}
public boolean contains(Charset cs) {
return ((cs.name().equals("US-ASCII"))
|| (cs instanceof JIS_X_0201_OLD)
|| (cs instanceof JIS_X_0208_OLD)
|| (cs instanceof JIS_X_0212_OLD)
|| (cs instanceof EUC_JP_OLD));
}
public CharsetDecoder newDecoder() {
return new Decoder(this);
}
public CharsetEncoder newEncoder() {
// Need to force the replacement byte to 0x3f
// because JIS_X_0208_Encoder defines its own
// alternative 2 byte substitution to permit it
// to exist as a self-standing Encoder
byte[] replacementBytes = { (byte)0x3f };
return new Encoder(this).replaceWith(replacementBytes);
}
static class Decoder extends JIS_X_0208_Decoder {
JIS_X_0201_OLD.Decoder decoderJ0201;
JIS_X_0212_Decoder decoderJ0212;
private static final short[] j0208Index1 =
JIS_X_0208_Decoder.getIndex1();
private static final String[] j0208Index2 =
JIS_X_0208_Decoder.getIndex2();
protected Decoder(Charset cs) {
super(cs);
decoderJ0201 = new JIS_X_0201_OLD.Decoder(cs);
decoderJ0212 = new JIS_X_0212_Decoder(cs);
start = 0xa1;
end = 0xfe;
}
protected char decode0212(int byte1, int byte2) {
return decoderJ0212.decodeDouble(byte1, byte2);
}
protected char decodeDouble(int byte1, int byte2) {
if (byte1 == 0x8e) {
return decoderJ0201.decode(byte2 - 256);
}
// Fix for bug 4121358 - similar fix for bug 4117820 put
// into ByteToCharDoubleByte.getUnicode()
if (((byte1 < 0) || (byte1 > getIndex1().length))
|| ((byte2 < start) || (byte2 > end)))
return REPLACE_CHAR;
int n = (j0208Index1[byte1 - 0x80] & 0xf) * (end - start + 1)
+ (byte2 - start);
return j0208Index2[j0208Index1[byte1 - 0x80] >> 4].charAt(n);
}
private CoderResult decodeArrayLoop(ByteBuffer src,
CharBuffer dst)
{
byte[] sa = src.array();
int sp = src.arrayOffset() + src.position();
int sl = src.arrayOffset() + src.limit();
assert (sp <= sl);
sp = (sp <= sl ? sp : sl);
char[] da = dst.array();
int dp = dst.arrayOffset() + dst.position();
int dl = dst.arrayOffset() + dst.limit();
assert (dp <= dl);
dp = (dp <= dl ? dp : dl);
int b1 = 0, b2 = 0;
int inputSize = 0;
char outputChar = REPLACE_CHAR; // U+FFFD;
try {
while (sp < sl) {
b1 = sa[sp] & 0xff;
inputSize = 1;
if ((b1 & 0x80) == 0) {
outputChar = (char)b1;
}
else { // Multibyte char
if ((b1 & 0xff) == 0x8f) { // JIS0212
if (sp + 3 > sl)
return CoderResult.UNDERFLOW;
b1 = sa[sp + 1] & 0xff;
b2 = sa[sp + 2] & 0xff;
inputSize += 2;
outputChar = decode0212(b1-0x80, b2-0x80);
} else {
// JIS0208
if (sp + 2 > sl)
return CoderResult.UNDERFLOW;
b2 = sa[sp + 1] & 0xff;
inputSize++;
outputChar = decodeDouble(b1, b2);
}
}
if (outputChar == REPLACE_CHAR) { // can't be decoded
return CoderResult.unmappableForLength(inputSize);
}
if (dp + 1 > dl)
return CoderResult.OVERFLOW;
da[dp++] = outputChar;
sp += inputSize;
}
return CoderResult.UNDERFLOW;
} finally {
src.position(sp - src.arrayOffset());
dst.position(dp - dst.arrayOffset());
}
}
private CoderResult decodeBufferLoop(ByteBuffer src,
CharBuffer dst)
{
int mark = src.position();
int b1 = 0, b2 = 0;
int inputSize = 0;
char outputChar = REPLACE_CHAR; // U+FFFD;
try {
while (src.hasRemaining()) {
b1 = src.get() & 0xff;
inputSize = 1;
if ((b1 & 0x80) == 0) {
outputChar = (char)b1;
} else { // Multibyte char
if ((b1 & 0xff) == 0x8f) { // JIS0212
if (src.remaining() < 2)
return CoderResult.UNDERFLOW;
b1 = src.get() & 0xff;
b2 = src.get() & 0xff;
inputSize += 2;
outputChar = decode0212(b1-0x80, b2-0x80);
} else {
// JIS0208
if (src.remaining() < 1)
return CoderResult.UNDERFLOW;
b2 = src.get() & 0xff;
inputSize++;
outputChar = decodeDouble(b1, b2);
}
}
if (outputChar == REPLACE_CHAR) {
return CoderResult.unmappableForLength(inputSize);
}
if (dst.remaining() < 1)
return CoderResult.OVERFLOW;
dst.put(outputChar);
mark += inputSize;
}
return CoderResult.UNDERFLOW;
} finally {
src.position(mark);
}
}
// Make some protected methods public for use by JISAutoDetect
public CoderResult decodeLoop(ByteBuffer src, CharBuffer dst) {
if (src.hasArray() && dst.hasArray())
return decodeArrayLoop(src, dst);
else
return decodeBufferLoop(src, dst);
}
public void implReset() {
super.implReset();
}
public CoderResult implFlush(CharBuffer out) {
return super.implFlush(out);
}
}
static class Encoder extends JIS_X_0208_Encoder {
JIS_X_0201_OLD.Encoder encoderJ0201;
JIS_X_0212_Encoder encoderJ0212;
private static final short[] j0208Index1 =
JIS_X_0208_Encoder.getIndex1();
private static final String[] j0208Index2 =
JIS_X_0208_Encoder.getIndex2();
private final Surrogate.Parser sgp = new Surrogate.Parser();
protected Encoder(Charset cs) {
super(cs, 3.0f, 3.0f);
encoderJ0201 = new JIS_X_0201_OLD.Encoder(cs);
encoderJ0212 = new JIS_X_0212_Encoder(cs);
}
public boolean canEncode(char c) {
byte[] encodedBytes = new byte[3];
if (encodeSingle(c, encodedBytes) == 0) { //doublebyte
if (encodeDouble(c) == 0)
return false;
}
return true;
}
protected int encodeSingle(char inputChar, byte[] outputByte) {
byte b;
if (inputChar == 0) {
outputByte[0] = (byte)0;
return 1;
}
if ((b = encoderJ0201.encode(inputChar)) == 0)
return 0;
if (b > 0 && b < 128) {
outputByte[0] = b;
return 1;
}
outputByte[0] = (byte)0x8e;
outputByte[1] = b;
return 2;
}
protected int encodeDouble(char ch) {
int offset = j0208Index1[((ch & 0xff00) >> 8 )] << 8;
int r = j0208Index2[offset >> 12].charAt((offset & 0xfff) +
(ch & 0xff));
if (r != 0)
return r + 0x8080;
r = encoderJ0212.encodeDouble(ch);
if (r == 0)
return r;
return r + 0x8F8080;
}
private CoderResult encodeArrayLoop(CharBuffer src,
ByteBuffer dst)
{
char[] sa = src.array();
int sp = src.arrayOffset() + src.position();
int sl = src.arrayOffset() + src.limit();
assert (sp <= sl);
sp = (sp <= sl ? sp : sl);
byte[] da = dst.array();
int dp = dst.arrayOffset() + dst.position();
int dl = dst.arrayOffset() + dst.limit();
assert (dp <= dl);
dp = (dp <= dl ? dp : dl);
int outputSize = 0;
byte[] outputByte;
int inputSize = 0; // Size of input
byte[] tmpBuf = new byte[3];
try {
while (sp < sl) {
outputByte = tmpBuf;
char c = sa[sp];
if (Character.isSurrogate(c)) {
if (sgp.parse(c, sa, sp, sl) < 0)
return sgp.error();
return sgp.unmappableResult();
}
outputSize = encodeSingle(c, outputByte);
if (outputSize == 0) { // DoubleByte
int ncode = encodeDouble(c);
if (ncode != 0 ) {
if ((ncode & 0xFF0000) == 0) {
outputByte[0] = (byte) ((ncode & 0xff00) >> 8);
outputByte[1] = (byte) (ncode & 0xff);
outputSize = 2;
} else {
outputByte[0] = (byte) 0x8f;
outputByte[1] = (byte) ((ncode & 0xff00) >> 8);
outputByte[2] = (byte) (ncode & 0xff);
outputSize = 3;
}
} else {
return CoderResult.unmappableForLength(1);
}
}
if (dl - dp < outputSize)
return CoderResult.OVERFLOW;
// Put the byte in the output buffer
for (int i = 0; i < outputSize; i++) {
da[dp++] = outputByte[i];
}
sp++;
}
return CoderResult.UNDERFLOW;
} finally {
src.position(sp - src.arrayOffset());
dst.position(dp - dst.arrayOffset());
}
}
private CoderResult encodeBufferLoop(CharBuffer src,
ByteBuffer dst)
{
int outputSize = 0;
byte[] outputByte;
int inputSize = 0; // Size of input
byte[] tmpBuf = new byte[3];
int mark = src.position();
try {
while (src.hasRemaining()) {
outputByte = tmpBuf;
char c = src.get();
if (Character.isSurrogate(c)) {
if (sgp.parse(c, src) < 0)
return sgp.error();
return sgp.unmappableResult();
}
outputSize = encodeSingle(c, outputByte);
if (outputSize == 0) { // DoubleByte
int ncode = encodeDouble(c);
if (ncode != 0 ) {
if ((ncode & 0xFF0000) == 0) {
outputByte[0] = (byte) ((ncode & 0xff00) >> 8);
outputByte[1] = (byte) (ncode & 0xff);
outputSize = 2;
} else {
outputByte[0] = (byte) 0x8f;
outputByte[1] = (byte) ((ncode & 0xff00) >> 8);
outputByte[2] = (byte) (ncode & 0xff);
outputSize = 3;
}
} else {
return CoderResult.unmappableForLength(1);
}
}
if (dst.remaining() < outputSize)
return CoderResult.OVERFLOW;
// Put the byte in the output buffer
for (int i = 0; i < outputSize; i++) {
dst.put(outputByte[i]);
}
mark++;
}
return CoderResult.UNDERFLOW;
} finally {
src.position(mark);
}
}
protected CoderResult encodeLoop(CharBuffer src,
ByteBuffer dst)
{
if (src.hasArray() && dst.hasArray())
return encodeArrayLoop(src, dst);
else
return encodeBufferLoop(src, dst);
}
}
}

View File

@ -0,0 +1,175 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
*/
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import sun.nio.cs.HistoricallyNamedCharset;
import sun.nio.cs.Surrogate;
public class EUC_JP_Open_OLD
extends Charset
implements HistoricallyNamedCharset
{
public EUC_JP_Open_OLD() {
super("x-eucJP-Open_OLD", null);
}
public String historicalName() {
return "EUC_JP_Solaris";
}
public boolean contains(Charset cs) {
return ((cs.name().equals("US-ASCII"))
|| (cs instanceof JIS_X_0201_OLD)
|| (cs instanceof EUC_JP_OLD));
}
public CharsetDecoder newDecoder() {
return new Decoder(this);
}
public CharsetEncoder newEncoder() {
// Need to force the replacement byte to 0x3f
// because JIS_X_0208_Encoder defines its own
// alternative 2 byte substitution to permit it
// to exist as a self-standing Encoder
byte[] replacementBytes = { (byte)0x3f };
return new Encoder(this).replaceWith(replacementBytes);
}
private static class Decoder extends EUC_JP_OLD.Decoder {
JIS_X_0201_OLD.Decoder decoderJ0201;
JIS_X_0212_Solaris_Decoder decodeMappingJ0212;
JIS_X_0208_Solaris_Decoder decodeMappingJ0208;
private static final short[] j0208Index1 =
JIS_X_0208_Solaris_Decoder.getIndex1();
private static final String[] j0208Index2 =
JIS_X_0208_Solaris_Decoder.getIndex2();
private static final int start = 0xa1;
private static final int end = 0xfe;
protected final char REPLACE_CHAR='\uFFFD';
private Decoder(Charset cs) {
super(cs);
decoderJ0201 = new JIS_X_0201_OLD.Decoder(cs);
decodeMappingJ0212 = new JIS_X_0212_Solaris_Decoder(cs);
}
protected char decode0212(int byte1, int byte2) {
return decodeMappingJ0212.decodeDouble(byte1, byte2);
}
protected char decodeDouble(int byte1, int byte2) {
if (byte1 == 0x8e) {
return decoderJ0201.decode(byte2 - 256);
}
if (((byte1 < 0)
|| (byte1 > j0208Index1.length))
|| ((byte2 < start)
|| (byte2 > end)))
return REPLACE_CHAR;
char result = super.decodeDouble(byte1, byte2);
if (result != '\uFFFD') {
return result;
} else {
int n = (j0208Index1[byte1 - 0x80] & 0xf) *
(end - start + 1)
+ (byte2 - start);
return j0208Index2[j0208Index1[byte1 - 0x80] >> 4].charAt(n);
}
}
}
private static class Encoder extends EUC_JP_OLD.Encoder {
JIS_X_0201_OLD.Encoder encoderJ0201;
JIS_X_0212_Solaris_Encoder encoderJ0212;
private static final short[] j0208Index1 =
JIS_X_0208_Solaris_Encoder.getIndex1();
private static final String[] j0208Index2 =
JIS_X_0208_Solaris_Encoder.getIndex2();
private final Surrogate.Parser sgp = new Surrogate.Parser();
private Encoder(Charset cs) {
super(cs);
encoderJ0201 = new JIS_X_0201_OLD.Encoder(cs);
encoderJ0212 = new JIS_X_0212_Solaris_Encoder(cs);
}
protected int encodeSingle(char inputChar, byte[] outputByte) {
byte b;
if (inputChar == 0) {
outputByte[0] = (byte)0;
return 1;
}
if ((b = encoderJ0201.encode(inputChar)) == 0)
return 0;
if (b > 0 && b < 128) {
outputByte[0] = b;
return 1;
}
outputByte[0] = (byte)0x8e;
outputByte[1] = b;
return 2;
}
protected int encodeDouble(char ch) {
int r = super.encodeDouble(ch);
if (r != 0) {
return r;
}
else {
int offset = j0208Index1[((ch & 0xff00) >> 8 )] << 8;
r = j0208Index2[offset >> 12].charAt((offset & 0xfff) +
(ch & 0xFF));
if (r > 0x7500)
return 0x8F8080 + encoderJ0212.encodeDouble(ch);
}
return (r==0 ? 0: r + 0x8080);
}
}
}

View File

@ -26,7 +26,6 @@
/*
*/
package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
@ -34,17 +33,17 @@ import java.nio.charset.CharsetEncoder;
import sun.nio.cs.SingleByteEncoder;
import sun.nio.cs.SingleByteDecoder;
public class JIS_X_0201
public class JIS_X_0201_OLD
extends Charset
{
public JIS_X_0201() {
super("JIS_X0201", ExtendedCharsets.aliasesFor("JIS_X0201"));
public JIS_X_0201_OLD() {
super("JIS_X0201_OLD", null);
}
public boolean contains(Charset cs) {
return ((cs.name().equals("US-ASCII"))
|| (cs instanceof JIS_X_0201));
|| (cs instanceof JIS_X_0201_OLD));
}
public CharsetDecoder newDecoder() {

View File

@ -26,7 +26,6 @@
/*
*/
package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;

View File

@ -26,7 +26,6 @@
/*
*/
package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;

View File

@ -26,22 +26,21 @@
/*
*/
package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
public class JIS_X_0208
public class JIS_X_0208_OLD
extends Charset
{
public JIS_X_0208() {
super("x-JIS0208", ExtendedCharsets.aliasesFor("x-JIS0208"));
public JIS_X_0208_OLD() {
super("x-JIS0208_OLD", null);
}
public boolean contains(Charset cs) {
return (cs instanceof JIS_X_0208);
return (cs instanceof JIS_X_0208_OLD);
}
public CharsetDecoder newDecoder() {

View File

@ -26,7 +26,6 @@
/*
*/
package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;

View File

@ -26,7 +26,6 @@
/*
*/
package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;

View File

@ -26,7 +26,6 @@
/*
*/
package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;

View File

@ -26,7 +26,6 @@
/*
*/
package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;

View File

@ -26,22 +26,21 @@
/*
*/
package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
public class JIS_X_0212
public class JIS_X_0212_OLD
extends Charset
{
public JIS_X_0212() {
super("JIS_X0212-1990", ExtendedCharsets.aliasesFor("JIS_X0212-1990"));
public JIS_X_0212_OLD() {
super("JIS_X0212-1990_OLD", null);
}
public boolean contains(Charset cs) {
return (cs instanceof JIS_X_0212);
return (cs instanceof JIS_X_0212_OLD);
}
public CharsetDecoder newDecoder() {

View File

@ -26,7 +26,6 @@
/*
*/
package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;

View File

@ -26,7 +26,6 @@
/*
*/
package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;

View File

@ -45,7 +45,7 @@ public class MS932_OLD extends Charset implements HistoricallyNamedCharset
public boolean contains(Charset cs) {
return ((cs.name().equals("US-ASCII"))
|| (cs instanceof JIS_X_0201)
|| (cs instanceof JIS_X_0201_OLD)
|| (cs instanceof MS932_OLD));
}
@ -61,11 +61,11 @@ public class MS932_OLD extends Charset implements HistoricallyNamedCharset
// implements DelegatableDecoder
{
JIS_X_0201.Decoder jisDec0201;
JIS_X_0201_OLD.Decoder jisDec0201;
private Decoder(Charset cs) {
super(cs);
jisDec0201 = new JIS_X_0201.Decoder(cs);
jisDec0201 = new JIS_X_0201_OLD.Decoder(cs);
}
protected char decodeSingle(int b) {
@ -90,12 +90,12 @@ public class MS932_OLD extends Charset implements HistoricallyNamedCharset
private static class Encoder extends MS932DB.Encoder {
private JIS_X_0201.Encoder jisEnc0201;
private JIS_X_0201_OLD.Encoder jisEnc0201;
private Encoder(Charset cs) {
super(cs);
jisEnc0201 = new JIS_X_0201.Encoder(cs);
jisEnc0201 = new JIS_X_0201_OLD.Encoder(cs);
}
protected int encodeSingle(char inputChar) {

View File

@ -26,8 +26,6 @@
/*
*/
package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
@ -36,13 +34,13 @@ import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import sun.nio.cs.HistoricallyNamedCharset;
public class PCK
public class PCK_OLD
extends Charset
implements HistoricallyNamedCharset
{
public PCK() {
super("x-PCK", ExtendedCharsets.aliasesFor("x-PCK"));
public PCK_OLD() {
super("x-PCK_OLD", null);
}
public String historicalName() {
@ -51,8 +49,8 @@ public class PCK
public boolean contains(Charset cs) {
return ((cs.name().equals("US-ASCII"))
|| (cs instanceof JIS_X_0201)
|| (cs instanceof PCK));
|| (cs instanceof JIS_X_0201_OLD)
|| (cs instanceof PCK_OLD));
}
public CharsetDecoder newDecoder() {
@ -70,7 +68,7 @@ public class PCK
return new Encoder(this).replaceWith(replacementBytes);
}
private static class Decoder extends SJIS.Decoder {
private static class Decoder extends SJIS_OLD.Decoder {
JIS_X_0208_Solaris_Decoder jis0208;
private static final char REPLACE_CHAR='\uFFFD';
@ -98,9 +96,9 @@ public class PCK
}
}
private static class Encoder extends SJIS.Encoder {
private static class Encoder extends SJIS_OLD.Encoder {
private JIS_X_0201.Encoder jis0201;
private JIS_X_0201_OLD.Encoder jis0201;
private static final short[] j0208Index1 =
JIS_X_0208_Solaris_Encoder.getIndex1();
@ -109,7 +107,7 @@ public class PCK
private Encoder(Charset cs) {
super(cs);
jis0201 = new JIS_X_0201.Encoder(cs);
jis0201 = new JIS_X_0201_OLD.Encoder(cs);
}
protected int encodeDouble(char ch) {

View File

@ -26,23 +26,20 @@
/*
*/
package sun.nio.cs.ext;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.*;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import sun.nio.cs.HistoricallyNamedCharset;
public class SJIS
public class SJIS_OLD
extends Charset
implements HistoricallyNamedCharset
{
public SJIS() {
super("Shift_JIS", ExtendedCharsets.aliasesFor("Shift_JIS"));
public SJIS_OLD() {
super("Shift_JIS_OLD", null);
}
public String historicalName() {
@ -51,9 +48,9 @@ public class SJIS
public boolean contains(Charset cs) {
return ((cs.name().equals("US-ASCII"))
|| (cs instanceof JIS_X_0201)
|| (cs instanceof SJIS)
|| (cs instanceof JIS_X_0208));
|| (cs instanceof JIS_X_0201_OLD)
|| (cs instanceof SJIS_OLD)
|| (cs instanceof JIS_X_0208_OLD));
}
public CharsetDecoder newDecoder() {
@ -71,14 +68,13 @@ public class SJIS
return new Encoder(this).replaceWith(replacementBytes);
}
static class Decoder extends JIS_X_0208_Decoder
implements DelegatableDecoder {
static class Decoder extends JIS_X_0208_Decoder {
JIS_X_0201.Decoder jis0201;
JIS_X_0201_OLD.Decoder jis0201;
protected Decoder(Charset cs) {
super(cs);
jis0201 = new JIS_X_0201.Decoder(cs);
jis0201 = new JIS_X_0201_OLD.Decoder(cs);
}
protected char decodeSingle(int b) {
@ -112,7 +108,7 @@ public class SJIS
static class Encoder extends JIS_X_0208_Encoder {
private JIS_X_0201.Encoder jis0201;
private JIS_X_0201_OLD.Encoder jis0201;
private static final short[] j0208Index1 =
JIS_X_0208_Encoder.getIndex1();
@ -121,7 +117,7 @@ public class SJIS
protected Encoder(Charset cs) {
super(cs);
jis0201 = new JIS_X_0201.Encoder(cs);
jis0201 = new JIS_X_0201_OLD.Encoder(cs);
}
protected int encodeSingle(char inputChar) {

View File

@ -26,7 +26,6 @@
/*
*/
package sun.nio.cs;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;

View File

@ -26,7 +26,6 @@
/*
*/
package sun.nio.cs;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;

View File

@ -24,8 +24,8 @@
/*
* @test
* @bug 6843578
* @summary Test IBM DB charsets
* @build IBM930_OLD IBM933_OLD IBM935_OLD IBM937_OLD IBM939_OLD IBM942_OLD IBM943_OLD IBM948_OLD IBM949_OLD IBM950_OLD IBM970_OLD IBM942C_OLD IBM943C_OLD IBM949C_OLD IBM1381_OLD IBM1383_OLD EUC_CN_OLD EUC_KR_OLD GBK_OLD Johab_OLD MS932_OLD MS936_OLD MS949_OLD MS950_OLD
* @summary Test old and new implementation of db charsets
* @build IBM930_OLD IBM933_OLD IBM935_OLD IBM937_OLD IBM939_OLD IBM942_OLD IBM943_OLD IBM948_OLD IBM949_OLD IBM950_OLD IBM970_OLD IBM942C_OLD IBM943C_OLD IBM949C_OLD IBM1381_OLD IBM1383_OLD EUC_CN_OLD EUC_KR_OLD GBK_OLD Johab_OLD MS932_OLD MS936_OLD MS949_OLD MS950_OLD SJIS_OLD PCK_OLD EUC_JP_OLD EUC_JP_LINUX_OLD EUC_JP_Open_OLD
* @run main TestIBMDB
*/
@ -490,6 +490,7 @@ if (sOld.charAt(0) == 0 && sNew.charAt(0) == 0xfffd)
}
static String[] csnames = new String[] {
"IBM930",
"IBM933",
"IBM935",
@ -515,12 +516,20 @@ if (sOld.charAt(0) == 0 && sNew.charAt(0) == 0xfffd)
"MS936",
"MS949",
"MS950",
"EUC_JP",
"EUC_JP_LINUX",
"EUC_JP_Open",
"SJIS",
"PCK",
};
public static void main(String[] args) throws Exception {
for (String csname: csnames) {
System.out.printf("-----------------------------------%n");
String oldname = csname + "_OLD";
if ("EUC_JP_Open".equals(csname))
csname = "eucjp-open";
checkInit(csname);
Charset csOld = (Charset)Class.forName(oldname).newInstance();
Charset csNew = Charset.forName(csname);

View File

@ -50,5 +50,20 @@ public class TestX11JIS0201 {
if (! cs.name().equals("X11JIS0201")){
throw new Exception("X11JIS0201 does not work correctly");
}
CharsetEncoder enc = cs.newEncoder();
char[] cc = new char[0xffff];
for (char c = 0; c < 0xffff; c++) {
cc[c] = c;
if (enc.canEncode(c) !=
((c >= 0xff61 && c <= 0xff9f) || c == 0x203e || c == 0xa5)) {
throw new RuntimeException("x11jis0201 canEncod() failed!");
}
}
String s = new String(cc);
byte[] bb_x11 = s.getBytes(cs);
byte[] bb = s.getBytes("jis0201");
if (!java.util.Arrays.equals(bb, bb_x11)) {
throw new RuntimeException("x11jis0201 encoding failed");
}
}
}