1 /* |
|
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <e32std.h> |
|
20 #include <e32def.h> |
|
21 |
|
22 struct TLeadOrSingle |
|
23 { |
|
24 /**iUnicodeIfSingle can have any of the following values... |
|
25 -Unicode character if this is a single byte character; |
|
26 -0xFFFD if it's an unidentified character; |
|
27 -0xFFFF if it's an "empty" Leadbyte -doesn't have any Tailbytes |
|
28 -0 if it's a Leadbyte*/ |
|
29 TUint16 iUnicodeIfSingle; |
|
30 /**Index into the double byte table.*/ |
|
31 TUint16 iDoubleByteIndex; |
|
32 }; |
|
33 |
|
34 class TConvDataStruct |
|
35 { |
|
36 public: |
|
37 static TInt ConvertSingleUnicode(TInt aUnicode, TInt& aTrailByte); |
|
38 |
|
39 public: |
|
40 /**Conversion table for single bytes and lead bytes from 0x80 to 0xFF.*/ |
|
41 static const TLeadOrSingle KFirstByteConversions[128]; |
|
42 /**The double-byte table, stores all Unicode values |
|
43 corresponding to double byte characters.*/ |
|
44 static const TUint16 KDoubleByteConversions[]; |
|
45 /**Length of double-byte conversion table.*/ |
|
46 static const TUint16 KDoubleByteConversionLength; |
|
47 /**Minimum calue a trail byte may take.*/ |
|
48 static const TUint8 KMinTrailByte; |
|
49 /**Maximum value a trail byte may take.*/ |
|
50 static const TUint8 KMaxTrailByte; |
|
51 }; |
|
52 |
|