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/. */
|
2001-07-17 04:20:22 +04:00
|
|
|
|
|
|
|
#include "nsJohabToUnicode.h"
|
|
|
|
#include "nsUCvKODll.h"
|
2002-09-07 05:17:57 +04:00
|
|
|
#include "nsUCConstructors.h"
|
2001-07-17 04:20:22 +04:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Global functions and data [declaration]
|
|
|
|
|
2006-08-07 11:57:31 +04:00
|
|
|
static const uScanClassID g_JOHABScanClassIDs[] = {
|
|
|
|
u1ByteCharset,
|
|
|
|
uJohabHangulCharset,
|
|
|
|
u2BytesCharset,
|
|
|
|
uJohabSymbolCharset,
|
|
|
|
uJohabSymbolCharset
|
2001-07-17 04:20:22 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
static const uRange g_JOHABRanges[] = {
|
|
|
|
{ 0x00, 0x7E },
|
|
|
|
{ 0x84, 0xD3 },
|
2002-07-14 14:28:48 +04:00
|
|
|
{ 0x84, 0xD3 },
|
2001-07-17 04:20:22 +04:00
|
|
|
{ 0xD8, 0xDE },
|
|
|
|
{ 0xE0, 0xF9 }
|
|
|
|
};
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
static const uint16_t g_utJohabJamoMapping[] ={
|
2002-07-14 14:28:48 +04:00
|
|
|
#include "johabjamo.ut"
|
|
|
|
};
|
2001-07-17 04:20:22 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
static const uint16_t *g_JOHABMappingTableSet [] ={
|
2012-10-17 05:34:03 +04:00
|
|
|
g_ASCIIMappingTable,
|
2001-07-17 04:20:22 +04:00
|
|
|
g_HangulNullMapping,
|
2002-07-14 14:28:48 +04:00
|
|
|
g_utJohabJamoMapping,
|
2001-07-17 04:20:22 +04:00
|
|
|
g_utKSC5601Mapping,
|
|
|
|
g_utKSC5601Mapping
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Class nsJohabToUnicode [implementation]
|
|
|
|
|
2010-06-10 22:11:40 +04:00
|
|
|
nsresult
|
2002-09-07 05:17:57 +04:00
|
|
|
nsJohabToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
|
|
|
|
void **aResult)
|
2001-07-17 04:20:22 +04:00
|
|
|
{
|
2002-09-07 05:17:57 +04:00
|
|
|
return CreateMultiTableDecoder(sizeof(g_JOHABRanges) / sizeof(g_JOHABRanges[0]),
|
2003-02-26 04:15:36 +03:00
|
|
|
(const uRange*) &g_JOHABRanges,
|
2006-08-07 11:57:31 +04:00
|
|
|
(uScanClassID*) &g_JOHABScanClassIDs,
|
2002-09-07 05:17:57 +04:00
|
|
|
(uMappingTable**) &g_JOHABMappingTableSet, 1,
|
|
|
|
aOuter, aIID, aResult);
|
2001-07-17 04:20:22 +04:00
|
|
|
}
|
|
|
|
|