2001-09-26 04:40:45 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-08-03 22:03:02 +04:00
|
|
|
|
|
|
|
#include "nsUnicodeToEUCJP.h"
|
|
|
|
#include "nsUCVJADll.h"
|
2002-09-07 05:17:57 +04:00
|
|
|
#include "nsUCConstructors.h"
|
1999-08-03 22:03:02 +04:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Global functions and data [declaration]
|
|
|
|
|
|
|
|
// Shift Table
|
2012-08-22 19:56:38 +04:00
|
|
|
static const int16_t g0201ShiftOutTable[] = {
|
2006-08-07 11:57:31 +04:00
|
|
|
2,
|
|
|
|
ShiftOutCell(u1ByteChar, 1, 0x00, 0x00, 0x00, 0x7F),
|
|
|
|
ShiftOutCell(u1BytePrefix8EChar, 2, 0x00, 0xA1, 0x00, 0xDF)
|
1999-08-03 22:03:02 +04:00
|
|
|
};
|
|
|
|
|
2011-03-26 15:43:40 +03:00
|
|
|
#define SIZE_OF_TABLES 3
|
2006-08-07 11:57:31 +04:00
|
|
|
static const uScanClassID gScanClassIDs[SIZE_OF_TABLES] = {
|
|
|
|
u2BytesGRCharset,
|
|
|
|
u2BytesGRCharset,
|
2011-03-26 15:43:40 +03:00
|
|
|
uMultibytesCharset
|
1999-08-03 22:03:02 +04:00
|
|
|
};
|
2006-08-07 11:57:31 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
static const int16_t *gShiftTables[SIZE_OF_TABLES] = {
|
2006-08-07 11:57:31 +04:00
|
|
|
0,
|
|
|
|
0,
|
2011-03-26 15:43:40 +03:00
|
|
|
g0201ShiftOutTable
|
1999-08-03 22:03:02 +04:00
|
|
|
};
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
static const uint16_t *gMappingTables[SIZE_OF_TABLES] = {
|
1999-08-03 22:03:02 +04:00
|
|
|
g_uf0208Mapping,
|
2001-03-30 07:16:10 +04:00
|
|
|
g_uf0208extMapping,
|
2011-03-26 15:43:40 +03:00
|
|
|
g_uf0201Mapping
|
1999-08-03 22:03:02 +04:00
|
|
|
};
|
|
|
|
|
2010-06-10 22:11:40 +04:00
|
|
|
nsresult
|
2002-09-07 05:17:57 +04:00
|
|
|
nsUnicodeToEUCJPConstructor(nsISupports *aOuter, REFNSIID aIID,
|
|
|
|
void **aResult)
|
1999-08-03 22:03:02 +04:00
|
|
|
{
|
2002-09-07 05:17:57 +04:00
|
|
|
return CreateMultiTableEncoder(SIZE_OF_TABLES,
|
2006-08-07 11:57:31 +04:00
|
|
|
(uScanClassID*) gScanClassIDs,
|
|
|
|
(uShiftOutTable**) gShiftTables,
|
2002-09-07 05:17:57 +04:00
|
|
|
(uMappingTable**) gMappingTables,
|
|
|
|
3 /* max length = src * 3 */,
|
|
|
|
aOuter, aIID, aResult);
|
1999-08-03 22:03:02 +04:00
|
|
|
}
|
|
|
|
|