深入理解字符串和字节数组转换
最重要的,就是转换得到的字符串,每个字符的编码和原来的编码可能并不相同,以代码页437为例,127以下的,转换后的字符和转换前的一样,而后面的就完全不同了。下面是437代码页的转换字符和原来内码的对照表。
- c {维数:[256]} int[]
[0] 0 int
[1] 1 int
[2] 2 int
[3] 3 int
[4] 4 int
[5] 5 int
[6] 6 int
[7] 7 int
[8] 8 int
[9] 9 int
[10]10 int
[11]11 int
[12]12 int
[13]13 int
[14]14 int
[15]15 int
[16]16 int
[17]17 int
[18]18 int
[19]19 int
[20]20 int
[21]21 int
[22]22 int
[23]23 int
[24]24 int
[25]25 int
[26]26 int
[27]27 int
[28]28 int
[29]29 int
[30]30 int
[31]31 int
[32]32 int
[33]33 int
[34]34 int
[35]35 int
[36]36 int
[37]37 int
[38]38 int
[39]39 int
[40]40 int
[41]41 int
[42]42 int
[43]43 int
[44]44 int
[45]45 int
[46]46 int
[47]47 int
[48]48 int
[49]49 int
[50]50 int
[51]51 int
[52]52 int
[53]53 int
[54]54 int
[55]55 int
[56]56 int
[57]57 int
[58]58 int
[59]59 int
[60]60 int
[61]61 int
[62]62 int
[63]63 int
[64]64 int
[65]65 int
[66]66 int
[67]67 int
[68]68 int
[69]69 int
[70]70 int
[71]71 int
[72]72 int
[73]73 int
[74]74 int
[75]75 int
[76]76 int
[77]77 int
[78]78 int
[79]79 int
[80]80 int
[81]81 int
[82]82 int
[83]83 int
[84]84 int
[85]85 int
[86]86 int
[87]87 int
[88]88 int
[89]89 int
[90]90 int
[91]91 int
[92]92 int
[93]93 int
[94]94 int
[95]95 int
[96]96 int
[97]97 int
[98]98 int
[99]99 int
[100] 100 int
[101] 101 int
[102] 102 int
[103] 103 int
[104] 104 int
[105] 105 int
[106] 106 int
[107] 107 int
[108] 108 int
[109] 109 int
[110] 110 int
[111] 111 int
[112] 112 int
[113] 113 int
[114] 114 int
[115] 115 int
[116] 116 int
[117] 117 int
[118] 118 int
[119] 119 int
[120] 120 int
[121] 121 int
[122] 122 int
[123] 123 int
[124] 124 int
[125] 125 int
[126] 126 int
[127] 127 int
[128] 199 int
[129] 252 int
[130] 233 int
[131] 226 int
[132] 228 int
[133] 224 int
[134] 229 int
[135] 231 int
[136] 234 int
[137] 235 int
[138] 232 int
[139] 239 int
[140] 238 int
[141] 236 int
[142] 196 int
[143] 197 int
[144] 201 int
[145] 230 int
[146] 198 int
[147] 244 int
[148] 246 int
[149] 242 int
[150] 251 int
[151] 249 int
[152] 255 int
[153] 214 int
[154] 220 int
[155] 162 int
[156] 163 int
[157] 165 int
[158] 8359 int
[159] 402 int
[160] 225 int
[161] 237 int
[162] 243 int
[163] 250 int
[164] 241 int
[165] 209 int
[166] 170 int
[167] 186 int
[168] 191 int
[169] 8976 int
[170] 172 int
[171] 189 int
[172] 188 int
[173] 161 int
[174] 171 int
[175] 187 int
[176] 9617 int
[177] 9618 int
[178] 9619 int
[179] 9474 int
[180] 9508 int
[181] 9569 int
[182] 9570 int
[183] 9558 int
[184] 9557 int
[185] 9571 int
[186] 9553 int
[187] 9559 int
[188] 9565 int
[189] 9564 int
[190] 9563 int
[191] 9488 int
[192] 9492 int
[193] 9524 int
[194] 9516 int
[195] 9500 int
[196] 9472 int
[197] 9532 int
[198] 9566 int
[199] 9567 int
[200] 9562 int
[201] 9556 int
[202] 9577 int
[203] 9574 int
[204] 9568 int
[205] 9552 int
[206] 9580 int
[207] 9575 int
[208] 9576 int
[209] 9572 int
[210] 9573 int
[211] 9561 int
[212] 9560 int
[213] 9554 int
[214] 9555 int
[215] 9579 int
[216] 9578 int
[217] 9496 int
[218] 9484 int
[219] 9608 int
[220] 9604 int
[221] 9612 int
[222] 9616 int
[223] 9600 int
[224] 945 int
[225] 223 int
[226] 915 int
[227] 960 int
[228] 931 int
[229] 963 int
[230] 181 int
[231] 964 int
[232] 934 int
[233] 920 int
[234] 937 int
[235] 948 int
[236] 8734 int
[237] 966 int
[238] 949 int
[239] 8745 int
[240] 8801 int
[241] 177 int
[242] 8805 int
[243] 8804 int
[244] 8992 int
[245] 8993 int
[246] 247 int
[247] 8776 int
[248] 176 int
[249] 8729 int
[250] 183 int
[251] 8730 int
[252] 8319 int
[253] 178 int
[254] 9632 int
[255] 160 int