intl/uconv/ucvja/nsUnicodeToEUCJP.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 "nsUnicodeToEUCJP.h"
     7 #include "nsUCVJADll.h"
     8 #include "nsUCConstructors.h"
    10 //----------------------------------------------------------------------
    11 // Global functions and data [declaration]
    13 // Shift Table
    14 static const int16_t g0201ShiftOutTable[] =  {
    15         2,
    16         ShiftOutCell(u1ByteChar,         1, 0x00, 0x00, 0x00, 0x7F),
    17         ShiftOutCell(u1BytePrefix8EChar, 2, 0x00, 0xA1, 0x00, 0xDF)
    18 };
    20 #define SIZE_OF_EUCJP_TABLES 3
    21 static const uScanClassID gScanClassIDs[SIZE_OF_EUCJP_TABLES] = {
    22   u2BytesGRCharset,
    23   u2BytesGRCharset,
    24   uMultibytesCharset
    25 };
    27 static const int16_t *gShiftTables[SIZE_OF_EUCJP_TABLES] =  {
    28     0,
    29     0,
    30     g0201ShiftOutTable
    31 };
    33 static const uint16_t *gMappingTables[SIZE_OF_EUCJP_TABLES] = {
    34     g_uf0208Mapping,
    35     g_uf0208extMapping,
    36     g_uf0201Mapping
    37 };
    39 nsresult
    40 nsUnicodeToEUCJPConstructor(nsISupports *aOuter, REFNSIID aIID,
    41                             void **aResult)
    42 {
    43     return CreateMultiTableEncoder(SIZE_OF_EUCJP_TABLES,
    44                                    (uScanClassID*) gScanClassIDs,
    45                                    (uShiftOutTable**) gShiftTables, 
    46                                    (uMappingTable**) gMappingTables,
    47                                    3 /* max length = src * 3 */,
    48                                    aOuter, aIID, aResult);
    49 }

mercurial