Update contrib.
2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: This file is a source code file for a charconv plug-in.
15 * This plug-in supports EUC-KR.
24 #include <convgeneratedcpp.h>
25 #include <ecom/implementationproxy.h>
26 #include "cp949table.h"
27 #include "charactersetconverter.h"
28 // New Interface class
29 class CEUCKRImplementation : public CCharacterSetConverterPluginInterface
32 virtual const TDesC8& ReplacementForUnconvertibleUnicodeCharacters();
34 virtual TInt ConvertFromUnicode(
35 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
36 const TDesC8& aReplacementForUnconvertibleUnicodeCharacters,
38 const TDesC16& aUnicode,
39 CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters );
41 virtual TInt ConvertToUnicode(
42 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
44 const TDesC8& aForeign,
46 TInt& aNumberOfUnconvertibleCharacters,
47 TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter );
49 virtual TBool IsInThisCharacterSetL(
51 TInt& aConfidenceLevel,
54 static CEUCKRImplementation* NewL();
56 virtual ~CEUCKRImplementation();
59 CEUCKRImplementation();
62 // FUNCTION DEFINITIONS
63 const TDesC8& CEUCKRImplementation::ReplacementForUnconvertibleUnicodeCharacters()
65 return CnvCp949Table::ReplacementForUnconvertibleUnicodeCharacters();
68 TInt CEUCKRImplementation::ConvertFromUnicode(
69 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
70 const TDesC8& aReplacementForUnconvertibleUnicodeCharacters,
72 const TDesC16& aUnicode,
73 CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters)
75 return CCnvCharacterSetConverter::DoConvertFromUnicode(CnvCp949Table::ConversionData(), aDefaultEndiannessOfForeignCharacters, aReplacementForUnconvertibleUnicodeCharacters, aForeign, aUnicode, aIndicesOfUnconvertibleCharacters);
78 TInt CEUCKRImplementation::ConvertToUnicode(
79 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
81 const TDesC8& aForeign,
83 TInt& aNumberOfUnconvertibleCharacters,
84 TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter)
86 return CCnvCharacterSetConverter::DoConvertToUnicode(CnvCp949Table::ConversionData(), aDefaultEndiannessOfForeignCharacters, aUnicode, aForeign, aNumberOfUnconvertibleCharacters, aIndexOfFirstByteOfFirstUnconvertibleCharacter);
90 TBool CEUCKRImplementation::IsInThisCharacterSetL(
92 TInt& aConfidenceLevel,
93 const TDesC8& /*aBuf*/)
100 for (TInt i=0;i<aBuf.Length();i++)
107 else if (0xa1<=ch&&ch<=0xfe)
110 __ASSERT_DEBUG(i<aBuf.Length(),User::Panic(_L("EUCKR"),__LINE__));
126 CEUCKRImplementation* CEUCKRImplementation::NewL()
128 CEUCKRImplementation* self = new(ELeave) CEUCKRImplementation;
132 CEUCKRImplementation::CEUCKRImplementation()
134 //default constructor.. do nothing
137 CEUCKRImplementation::~CEUCKRImplementation()
139 //default destructor .. do nothing
142 // ECOM CREATION FUNCTION
143 const TImplementationProxy ImplementationTable[] =
145 // Note: This is the same UID as defined in old mmp-file
146 // Used also in 12221212.rss ( implementation_uid )
147 IMPLEMENTATION_PROXY_ENTRY( 0x2000E526, CEUCKRImplementation::NewL )
150 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
152 aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy);
153 return ImplementationTable;