Bug 799910 - Fix ASCII range of EUC-KR and Big5 converters. r=smontagu
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Tue, 16 Oct 2012 21:34:03 -0400
changeset 110493 70e45c7aa3ba26db59b91e24d204788b1281b5e4
parent 110492 4f8830d30f623af5b0f3d10ab6ca7d9b44204759
child 110494 b508524e3126f07f6940aaa86687db63603f8a31
push id23695
push userryanvm@gmail.com
push dateWed, 17 Oct 2012 18:08:27 +0000
treeherdermozilla-central@a76c1f4c4112 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmontagu
bugs799910
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 799910 - Fix ASCII range of EUC-KR and Big5 converters. r=smontagu
dom/encoding/test/unit/test_singlebytes.js
intl/uconv/src/nsUConvModule.cpp
intl/uconv/ucvko/nsCP949ToUnicode.cpp
intl/uconv/ucvko/nsJohabToUnicode.cpp
intl/uconv/ucvko/nsUCvKODll.h
intl/uconv/ucvko/nsUnicodeToCP949.cpp
intl/uconv/ucvko/nsUnicodeToEUCKR.cpp
intl/uconv/ucvko/nsUnicodeToJohab.cpp
intl/uconv/ucvtw/nsBIG5HKSCSToUnicode.cpp
intl/uconv/ucvtw/nsBIG5ToUnicode.cpp
intl/uconv/ucvtw/nsUCvTWDll.h
intl/uconv/ucvtw/nsUnicodeToBIG5.cpp
intl/uconv/ucvtw/nsUnicodeToBIG5HKSCS.cpp
--- a/dom/encoding/test/unit/test_singlebytes.js
+++ b/dom/encoding/test/unit/test_singlebytes.js
@@ -340,19 +340,16 @@ test(
 
         // Encodings that have escape codes in 0x00-0x7F
         if (encoding === "hz-gb-2312" && i === 0x7E)
           continue;
         if (encoding === "iso-2022-jp" && i === 0x1B)
           continue;
         if (encoding === "iso-2022-kr" && (i === 0x0E || i === 0x0F || i === 0x1B))
           continue;
-        // TODO: Gecko decoder bugs
-        if ((encoding === "big5" || encoding === "euc-kr") && i === 0x7F)
-          continue;
 
         string += String.fromCharCode(i);
         bytes.push(i);
       }
       var ascii_encoded = TextEncoder('utf-8').encode(string);
       equal(TextDecoder(encoding).decode(ascii_encoded), string, encoding);
       if (encoding === "utf-8") {
         arrayEqual(TextEncoder(encoding).encode(string), bytes, encoding);
--- a/intl/uconv/src/nsUConvModule.cpp
+++ b/intl/uconv/src/nsUConvModule.cpp
@@ -481,37 +481,29 @@ const uint16_t g_ufBig5Mapping[] = {
 const uint16_t g_utBIG5Mapping[] = {
 #include "big5.ut"
 };
 
 const uint16_t g_ufBig5HKSCSMapping[] = {
 #include "hkscs.uf"
 };
 
-const uint16_t g_ASCIIMapping[] = {
-  0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0x0000, 0x007F, 0x0000
-};
-
 const uint16_t g_utBig5HKSCSMapping[] = {
 #include "hkscs.ut"
 };
 
 // ucvko
 const uint16_t g_utKSC5601Mapping[] = {
 #include "u20kscgl.ut"
 };
 
 const uint16_t g_ufKSC5601Mapping[] = {
 #include "u20kscgl.uf"
 };
 
-const uint16_t g_ucvko_AsciiMapping[] = {
-  0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0x0000, 0x007F, 0x0000
-};
-
 const uint16_t g_HangulNullMapping[] ={
   0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0xAC00, 0xD7A3, 0xAC00
 };
 
 const uint16_t g_ufJohabJamoMapping[] ={   
 #include "johabjamo.uf"
 };
 
--- a/intl/uconv/ucvko/nsCP949ToUnicode.cpp
+++ b/intl/uconv/ucvko/nsCP949ToUnicode.cpp
@@ -23,26 +23,26 @@ static const uScanClassID g_CP949ScanCla
 };
 
 // CP949(non-EUC-KR portion) to Unicode
 static const uint16_t g_utCP949NoKSCHangulMapping[] = {
 #include "u20cp949hangul.ut"
 };
 
 static const uRange g_CP949Ranges[] = {
-  { 0x00, 0x7E },
+  { 0x00, 0x7F },
   { 0xA4, 0xA4 },   // 8byte seq. for Hangul syllables not available
                     // in pre-composed form in KS X 1001
   { 0xA1, 0xFE },
   { 0xA1, 0xC6 },   // CP949 extension B. ends at 0xC6.
   { 0x80, 0xA0 }
 };
 
 static const uint16_t *g_CP949MappingTableSet [] ={
-  g_ucvko_AsciiMapping,
+  g_ASCIIMappingTable,
   g_HangulNullMapping,
   g_utKSC5601Mapping,
   g_utCP949NoKSCHangulMapping,
   g_utCP949NoKSCHangulMapping
 //g_CP949HighMapping,
 //g_CP949LowMapping
 };
 
--- a/intl/uconv/ucvko/nsJohabToUnicode.cpp
+++ b/intl/uconv/ucvko/nsJohabToUnicode.cpp
@@ -26,17 +26,17 @@ static const uRange g_JOHABRanges[] = {
   { 0xE0, 0xF9 }
 };
 
 static const uint16_t g_utJohabJamoMapping[] ={   
 #include "johabjamo.ut"
 };
 
 static const uint16_t *g_JOHABMappingTableSet [] ={
-  g_ucvko_AsciiMapping,
+  g_ASCIIMappingTable,
   g_HangulNullMapping,
   g_utJohabJamoMapping,
   g_utKSC5601Mapping,
   g_utKSC5601Mapping
 };
 
 
 //----------------------------------------------------------------------
--- a/intl/uconv/ucvko/nsUCvKODll.h
+++ b/intl/uconv/ucvko/nsUCvKODll.h
@@ -5,13 +5,13 @@
 
 #ifndef nsUCvKODll_h___
 #define nsUCvKODll_h___
 
 #include "prtypes.h"
 
 extern const uint16_t g_utKSC5601Mapping[];
 extern const uint16_t g_ufKSC5601Mapping[];
-extern const uint16_t g_ucvko_AsciiMapping[];
+extern const uint16_t g_ASCIIMappingTable[];
 extern const uint16_t g_HangulNullMapping[];
 extern const uint16_t g_ufJohabJamoMapping[];
 
 #endif /* nsUCvKODll_h___ */
--- a/intl/uconv/ucvko/nsUnicodeToCP949.cpp
+++ b/intl/uconv/ucvko/nsUnicodeToCP949.cpp
@@ -15,17 +15,17 @@
 // Unicode Hangul syllables (not enumerated in KS X 1001) to CP949 : 8822 of them
 static const uint16_t g_ufCP949NoKSCHangulMapping[] = {
 #include "u20cp949hangul.uf"
 };
 
 
 
 static const uint16_t *g_CP949MappingTable[3] = {
-  g_ucvko_AsciiMapping,
+  g_ASCIIMappingTable,
   g_ufKSC5601Mapping,
   g_ufCP949NoKSCHangulMapping
 };
 
 static const uScanClassID g_CP949ScanClassTable[3] =  {
   u1ByteCharset,
   u2BytesGRCharset,
   u2BytesCharset
--- a/intl/uconv/ucvko/nsUnicodeToEUCKR.cpp
+++ b/intl/uconv/ucvko/nsUnicodeToEUCKR.cpp
@@ -7,17 +7,17 @@
 #include "nsUCvKODll.h"
 #include "nsUCConstructors.h"
 
 //----------------------------------------------------------------------
 // Global functions and data [declaration]
 
 
 static const uint16_t *g_EUCKRMappingTable[3] = {
-  g_ucvko_AsciiMapping,
+  g_ASCIIMappingTable,
   g_ufKSC5601Mapping,
   g_HangulNullMapping
 };
 
 static const uScanClassID g_EUCKRScanCellIDTable[3] =  {
   u1ByteCharset,
   u2BytesGRCharset,
   uDecomposedHangulCharset
--- a/intl/uconv/ucvko/nsUnicodeToJohab.cpp
+++ b/intl/uconv/ucvko/nsUnicodeToJohab.cpp
@@ -6,17 +6,17 @@
 #include "nsUnicodeToJohab.h"
 #include "nsUCvKODll.h"
 #include "nsUCConstructors.h"
 
 //----------------------------------------------------------------------
 // Global functions and data [declaration]
 
 static const uint16_t *g_JohabMappingTable[4] = {
-  g_ucvko_AsciiMapping,
+  g_ASCIIMappingTable,
   g_HangulNullMapping,
   g_ufJohabJamoMapping,
   g_ufKSC5601Mapping
 };
 
 static const uScanClassID g_JohabScanClassTable[4] =  {
   u1ByteCharset,
   uJohabHangulCharset,
--- a/intl/uconv/ucvtw/nsBIG5HKSCSToUnicode.cpp
+++ b/intl/uconv/ucvtw/nsBIG5HKSCSToUnicode.cpp
@@ -15,26 +15,26 @@ static const uScanClassID g_BIG5HKSCSSca
   u2BytesCharset,
   u2BytesCharset,
   u2BytesCharset,
   u2BytesCharset,
   u2BytesCharset
 };
 
 static const uint16_t *g_BIG5HKSCSMappingTableSet [] ={
-  g_ASCIIMapping,
+  g_ASCIIMappingTable,
   g_utBig5HKSCSMapping,
   g_utBIG5Mapping,
   g_utBig5HKSCSMapping,
   g_utBIG5Mapping,
   g_utBig5HKSCSMapping,
 };
 
 static const uRange g_BIG5HKSCSRanges[] = {
-  { 0x00, 0x7E },
+  { 0x00, 0x7F },
   { 0x81, 0xA0 },
   { 0xA1, 0xC6 },
   { 0xC6, 0xC8 },
   { 0xC9, 0xF9 },
   { 0xF9, 0xFE }
 };
 
 //----------------------------------------------------------------------
--- a/intl/uconv/ucvtw/nsBIG5ToUnicode.cpp
+++ b/intl/uconv/ucvtw/nsBIG5ToUnicode.cpp
@@ -11,22 +11,22 @@
 // Global functions and data [declaration]
 
 static const uScanClassID g_BIG5ScanClassIDs[] = {
   u1ByteCharset,
   u2BytesCharset
 };
 
 static const uint16_t *g_BIG5MappingTableSet [] ={
-  g_ASCIIMapping,
+  g_ASCIIMappingTable,
   g_utBIG5Mapping
 };
 
 static const uRange g_BIG5Ranges[] = {
-  { 0x00, 0x7E },
+  { 0x00, 0x7F },
   { 0x81, 0xFE }
 };
 
 nsresult
 nsBIG5ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
                            void **aResult)
 {
   return CreateMultiTableDecoder(2, 
--- a/intl/uconv/ucvtw/nsUCvTWDll.h
+++ b/intl/uconv/ucvtw/nsUCvTWDll.h
@@ -5,13 +5,13 @@
 
 #ifndef nsUCvTWDll_h___
 #define nsUCvTWDll_h___
 
 #include "prtypes.h"
 
 extern const uint16_t g_ufBig5Mapping[];
 extern const uint16_t g_utBIG5Mapping[];
-extern const uint16_t g_ASCIIMapping[];
+extern const uint16_t g_ASCIIMappingTable[];
 extern const uint16_t g_ufBig5HKSCSMapping[];
 extern const uint16_t g_utBig5HKSCSMapping[];
 
 #endif /* nsUCvTWDll_h___ */
--- a/intl/uconv/ucvtw/nsUnicodeToBIG5.cpp
+++ b/intl/uconv/ucvtw/nsUnicodeToBIG5.cpp
@@ -7,17 +7,17 @@
 #include "nsUCvTWDll.h"
 #include "nsUCConstructors.h"
 
 //----------------------------------------------------------------------
 // Global functions and data [declaration]
 
 
 static const uint16_t *g_Big5MappingTable[2] = {
-  g_ASCIIMapping,
+  g_ASCIIMappingTable,
   g_ufBig5Mapping
 };
 
 static const uScanClassID g_Big5ScanClassIDs[2] =  {
   u1ByteCharset,
   u2BytesCharset
 };
 
--- a/intl/uconv/ucvtw/nsUnicodeToBIG5HKSCS.cpp
+++ b/intl/uconv/ucvtw/nsUnicodeToBIG5HKSCS.cpp
@@ -7,17 +7,17 @@
 #include "nsUCvTWDll.h"
 #include "nsUCConstructors.h"
 
 //----------------------------------------------------------------------
 // Global functions and data [declaration]
 
 
 static const uint16_t *g_Big5HKSCSMappingTable[] = {
-  g_ASCIIMapping,
+  g_ASCIIMappingTable,
   g_ufBig5Mapping,
   g_ufBig5HKSCSMapping
 };
 
 static const uScanClassID g_Big5HKSCSScanClassIDs[] =  {
   u1ByteCharset,
   u2BytesCharset,
   u2BytesCharset