diff options
Diffstat (limited to 'encoding_jis.js')
| -rw-r--r-- | encoding_jis.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/encoding_jis.js b/encoding_jis.js index c6152d4..7550c7b 100644 --- a/encoding_jis.js +++ b/encoding_jis.js | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | // | 3 | // |
| 4 | // The unicode codes in second table have been normalized by | 4 | // The unicode codes in second table have been normalized by |
| 5 | // the amount of 19968 to save 5kBytes in this script, so the | 5 | // the amount of 19968 to save 5kBytes in this script, so the |
| 6 | // actual value is 19968 + encoding_jis_0208_1[ x ] | 6 | // actual value is 19968 + enc_jis_0208_1[ x ] |
| 7 | 7 | ||
| 8 | var page = { | 8 | var page = { |
| 9 | us_ascii : 0, | 9 | us_ascii : 0, |
| @@ -44,7 +44,7 @@ function decode_jis( str ) { | |||
| 44 | case page.jis0201: | 44 | case page.jis0201: |
| 45 | var off = str.charCodeAt( i ) & 0xff; | 45 | var off = str.charCodeAt( i ) & 0xff; |
| 46 | if( off >= 0x20 && x <= 0xdf ) { | 46 | if( off >= 0x20 && x <= 0xdf ) { |
| 47 | append = String.fromCharCode( encoding_jis_0201[ off - 32 ] ); | 47 | append = String.fromCharCode( enc_jis_0201[ off - 32 ] ); |
| 48 | } | 48 | } |
| 49 | break; | 49 | break; |
| 50 | case page.jis0208: | 50 | case page.jis0208: |
| @@ -54,9 +54,9 @@ function decode_jis( str ) { | |||
| 54 | if( x0 <= 0x52 && x1 <= 0x5d ) { | 54 | if( x0 <= 0x52 && x1 <= 0x5d ) { |
| 55 | var off = x0 * 94 + x1; | 55 | var off = x0 * 94 + x1; |
| 56 | if( off < 690 ) { | 56 | if( off < 690 ) { |
| 57 | append = String.fromCharCode( encoding_jis_0208_0[off] ); | 57 | append = String.fromCharCode( enc_jis_0208_0[off] ); |
| 58 | } else if( off >= 1410 ) { | 58 | } else if( off >= 1410 ) { |
| 59 | append = String.fromCharCode( 19968 + encoding_jis_0208_1[off-1410] ); | 59 | append = String.fromCharCode( 19968 + enc_jis_0208_1[off-1410] ); |
| 60 | } | 60 | } |
| 61 | } | 61 | } |
| 62 | break; | 62 | break; |
| @@ -68,10 +68,10 @@ function decode_jis( str ) { | |||
| 68 | return outstring; | 68 | return outstring; |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | var encoding_jis_0201 = | 71 | var enc_jis_0201 = |
| 72 | [65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,165,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,8254,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65377,65378,65379,65380,65381,65382,65383,65384,65385,65386,65387,65388,65389,65390,65391,65392,65393,65394,65395,65396,65397,65398,65399,65400,65401,65402,65403,65404,65405,65406,65407,65408,65409,65410,65411,65412,65413,65414,65415,65416,65417,65418,65419,65420,65421,65422,65423,65424,65425,65426,65427,65428,65429,65430,65431,65432,65433,65434,65435,65436,65437,65438,65439]; | 72 | [65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,165,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,8254,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65377,65378,65379,65380,65381,65382,65383,65384,65385,65386,65387,65388,65389,65390,65391,65392,65393,65394,65395,65396,65397,65398,65399,65400,65401,65402,65403,65404,65405,65406,65407,65408,65409,65410,65411,65412,65413,65414,65415,65416,65417,65418,65419,65420,65421,65422,65423,65424,65425,65426,65427,65428,65429,65430,65431,65432,65433,65434,65435,65436,65437,65438,65439]; |
| 73 | 73 | ||
| 74 | var encoding_jis_0208_0 = | 74 | var enc_jis_0208_0 = |
| 75 | [12288,12289,12290,65292,65294,12539,65306,65307,65311,65281,12443,12444,180,65344,168,65342,65507,65343,12541,12542,12445,12446,12291,20189,12293, | 75 | [12288,12289,12290,65292,65294,12539,65306,65307,65311,65281,12443,12444,180,65344,168,65342,65507,65343,12541,12542,12445,12446,12291,20189,12293, |
| 76 | 12294,12295,12540,8213,8208,65295,92,12316,8214,65372,8230,8229,8216,8217,8220,8221,65288,65289,12308,12309,65339,65341,65371,65373,12296, | 76 | 12294,12295,12540,8213,8208,65295,92,12316,8214,65372,8230,8229,8216,8217,8220,8221,65288,65289,12308,12309,65339,65341,65371,65373,12296, |
| 77 | 12297,12298,12299,12300,12301,12302,12303,12304,12305,65291,8722,177,215,247,65309,8800,65308,65310,8806,8807,8734,8756,9794,9792,176, | 77 | 12297,12298,12299,12300,12301,12302,12303,12304,12305,65291,8722,177,215,247,65309,8800,65308,65310,8806,8807,8734,8756,9794,9792,176, |
| @@ -101,7 +101,7 @@ var encoding_jis_0208_0 = | |||
| 101 | 65533,65533,65533,65533,65533,65533,65533,65533,9472,9474,9484,9488,9496,9492,9500,9516,9508,9524,9532,9473,9475,9487,9491,9499,9495, | 101 | 65533,65533,65533,65533,65533,65533,65533,65533,9472,9474,9484,9488,9496,9492,9500,9516,9508,9524,9532,9473,9475,9487,9491,9499,9495, |
| 102 | 9507,9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,9509,9528,9538]; | 102 | 9507,9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,9509,9528,9538]; |
| 103 | 103 | ||
| 104 | var encoding_jis_0208_1 = | 104 | var enc_jis_0208_1 = |
| 105 | [156,1814,3075,18495,1728,4891,5416,3062,16930,13941,13596,11344,4778,5601,8229,6125,13926,13478,19957,6803,2343,6049,5233,3483,3024, | 105 | [156,1814,3075,18495,1728,4891,5416,3062,16930,13941,13596,11344,4778,5601,8229,6125,13926,13478,19957,6803,2343,6049,5233,3483,3024, |
| 106 | 14459,19188,12130,12222,19854,5142,11935,15031,3465,4277,5385,6295,6728,18375,18829,6479,229,266,333,413,585,2290,2871,3028,3073,3593, | 106 | 14459,19188,12130,12222,19854,5142,11935,15031,3465,4277,5385,6295,6728,18375,18829,6479,229,266,333,413,585,2290,2871,3028,3073,3593, |
| 107 | 4831,4879,4976,6163,6917,8890,10063,10096,11259,12205,12271,12995,13838,14947,15618,16981,17018,1339,149,165,2527,12978,17089,10991,0, | 107 | 4831,4879,4976,6163,6917,8890,10063,10096,11259,12205,12271,12995,13838,14947,15618,16981,17018,1339,149,165,2527,12978,17089,10991,0, |
