intl/uconv/ucvtw2/nsEUCTWToUnicode.cpp

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #include "nsEUCTWToUnicode.h"
     7 #include "nsUCvTW2Dll.h"
     8 #include "nsUCConstructors.h"
    10 //----------------------------------------------------------------------
    11 // Global functions and data [declaration]
    13 //----------------------------------------------------------------------
    14 // Class nsEUCTWToUnicode [implementation]
    16 nsresult
    17 nsEUCTWToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
    18                                 void **aResult)
    19 {
    20   static const uScanClassID g_EUCTWScanClassIDs [] = {
    21     u1ByteCharset,
    22     u2BytesGRCharset,
    23     u2BytesGRPrefix8EA2Charset,
    24     u2BytesGRPrefix8EA3Charset,
    25     u2BytesGRPrefix8EA4Charset,
    26     u2BytesGRPrefix8EA5Charset,
    27     u2BytesGRPrefix8EA6Charset,
    28     u2BytesGRPrefix8EA7Charset
    29   };
    31   static const uint16_t *g_EUCTWMappingTableSet [] ={
    32     g_ASCIIMappingTable,
    33     g_utCNS1MappingTable,
    34     g_utCNS2MappingTable,
    35     g_utCNS3MappingTable,
    36     g_utCNS4MappingTable,
    37     g_utCNS5MappingTable,
    38     g_utCNS6MappingTable,
    39     g_utCNS7MappingTable
    40   };
    42   static const uRange g_EUCTWRanges[] = {
    43     { 0x00, 0x7E },
    44     { 0xA1, 0xFE },
    45     { 0x8E, 0x8E },
    46     { 0x8E, 0x8E },
    47     { 0x8E, 0x8E },
    48     { 0x8E, 0x8E },
    49     { 0x8E, 0x8E },
    50     { 0x8E, 0x8E }
    51   };
    53   return CreateMultiTableDecoder(8, 
    54                                  (const uRange*) &g_EUCTWRanges,
    55                                  (uScanClassID*) &g_EUCTWScanClassIDs,
    56                                  (uMappingTable**) &g_EUCTWMappingTableSet,
    57                                  1, aOuter, aIID, aResult);
    58 }

mercurial