2001-09-26 04:47:52 +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/. */
|
2001-03-28 03:38:31 +04:00
|
|
|
|
|
|
|
#include "nsBIG5HKSCSToUnicode.h"
|
|
|
|
#include "nsUCvTWDll.h"
|
2002-09-07 05:17:57 +04:00
|
|
|
#include "nsUCConstructors.h"
|
2001-03-28 03:38:31 +04:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Global functions and data [declaration]
|
|
|
|
|
2006-08-07 11:57:31 +04:00
|
|
|
static const uScanClassID g_BIG5HKSCSScanClassIDs[] = {
|
|
|
|
u1ByteCharset,
|
|
|
|
u2BytesCharset,
|
|
|
|
u2BytesCharset,
|
|
|
|
u2BytesCharset,
|
|
|
|
u2BytesCharset,
|
|
|
|
u2BytesCharset
|
2001-03-28 03:38:31 +04:00
|
|
|
};
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
static const uint16_t *g_BIG5HKSCSMappingTableSet [] ={
|
2012-10-17 05:34:03 +04:00
|
|
|
g_ASCIIMappingTable,
|
2001-03-28 03:38:31 +04:00
|
|
|
g_utBig5HKSCSMapping,
|
|
|
|
g_utBIG5Mapping,
|
|
|
|
g_utBig5HKSCSMapping,
|
|
|
|
g_utBIG5Mapping,
|
|
|
|
g_utBig5HKSCSMapping,
|
|
|
|
};
|
|
|
|
|
2001-05-17 04:02:21 +04:00
|
|
|
static const uRange g_BIG5HKSCSRanges[] = {
|
2012-10-17 05:34:03 +04:00
|
|
|
{ 0x00, 0x7F },
|
2001-03-28 03:38:31 +04:00
|
|
|
{ 0x81, 0xA0 },
|
|
|
|
{ 0xA1, 0xC6 },
|
|
|
|
{ 0xC6, 0xC8 },
|
|
|
|
{ 0xC9, 0xF9 },
|
|
|
|
{ 0xF9, 0xFE }
|
|
|
|
};
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Class nsBIG5HKSCSToUnicode [implementation]
|
|
|
|
|
2010-06-10 22:11:40 +04:00
|
|
|
nsresult
|
2002-09-07 05:17:57 +04:00
|
|
|
nsBIG5HKSCSToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
|
|
|
|
void **aResult)
|
2001-03-28 03:38:31 +04:00
|
|
|
{
|
2002-09-07 05:17:57 +04:00
|
|
|
return CreateMultiTableDecoder(6,
|
2003-02-26 04:15:36 +03:00
|
|
|
(const uRange* ) &g_BIG5HKSCSRanges,
|
2006-08-07 11:57:31 +04:00
|
|
|
(uScanClassID*) &g_BIG5HKSCSScanClassIDs,
|
2002-09-07 05:17:57 +04:00
|
|
|
(uMappingTable**) &g_BIG5HKSCSMappingTableSet,
|
|
|
|
1,
|
|
|
|
aOuter, aIID, aResult);
|
2001-03-28 03:38:31 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|