intl/uconv/ucvtw2/nsUnicodeToEUCTW.cpp

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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 "nsUnicodeToEUCTW.h"
     7 #include "nsUCvTW2Dll.h"
     8 #include "nsUCConstructors.h"
    10 //----------------------------------------------------------------------
    11 // Global functions and data [declaration]
    13 //----------------------------------------------------------------------
    14 // Class nsUnicodeToEUCTW [implementation]
    16 nsresult
    17 nsUnicodeToEUCTWConstructor(nsISupports *aOuter, REFNSIID aIID,
    18                             void **aResult)
    19 {
    20   static const uScanClassID g_EUCTWScanClassSet [] = {
    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_ufCNS1MappingTable,
    34     g_ufCNS2MappingTable,
    35     g_ufCNS3MappingTable,
    36     g_ufCNS4MappingTable,
    37     g_ufCNS5MappingTable,
    38     g_ufCNS6MappingTable,
    39     g_ufCNS7MappingTable
    40   };
    42   return CreateMultiTableEncoder(8,
    43                                  (uScanClassID*) &g_EUCTWScanClassSet,
    44                                  (uMappingTable**) &g_EUCTWMappingTableSet,
    45                                  4 /* max length = src * 4 */,
    46                                  aOuter, aIID, aResult);
    47 }

mercurial