From aeadb20b9f264e560bc8ecb38f0288f7326f6556 Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Wed, 11 Jun 2008 23:16:47 +0000 Subject: Added support for gb2312 encoding. --- encoding_jis.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'encoding_jis.js') 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 @@ // // The unicode codes in second table have been normalized by // the amount of 19968 to save 5kBytes in this script, so the -// actual value is 19968 + encoding_jis_0208_1[ x ] +// actual value is 19968 + enc_jis_0208_1[ x ] var page = { us_ascii : 0, @@ -44,7 +44,7 @@ function decode_jis( str ) { case page.jis0201: var off = str.charCodeAt( i ) & 0xff; if( off >= 0x20 && x <= 0xdf ) { - append = String.fromCharCode( encoding_jis_0201[ off - 32 ] ); + append = String.fromCharCode( enc_jis_0201[ off - 32 ] ); } break; case page.jis0208: @@ -54,9 +54,9 @@ function decode_jis( str ) { if( x0 <= 0x52 && x1 <= 0x5d ) { var off = x0 * 94 + x1; if( off < 690 ) { - append = String.fromCharCode( encoding_jis_0208_0[off] ); + append = String.fromCharCode( enc_jis_0208_0[off] ); } else if( off >= 1410 ) { - append = String.fromCharCode( 19968 + encoding_jis_0208_1[off-1410] ); + append = String.fromCharCode( 19968 + enc_jis_0208_1[off-1410] ); } } break; @@ -68,10 +68,10 @@ function decode_jis( str ) { return outstring; } -var encoding_jis_0201 = +var enc_jis_0201 = [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]; -var encoding_jis_0208_0 = +var enc_jis_0208_0 = [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, 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, 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 = 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, 9507,9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,9509,9528,9538]; -var encoding_jis_0208_1 = +var enc_jis_0208_1 = [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, 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, 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, -- cgit v1.2.3