charconvfw/Charconvplugin/src/G_WIN1254.cpp
changeset 32 8b9155204a54
equal deleted inserted replaced
31:b9ad20498fb4 32:8b9155204a54
       
     1 /*
       
     2 * Copyright (c) 1254 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 the License "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 
       
    20 
       
    21 #include <e32std.h>
       
    22 #include <convdata.h>
       
    23 #include <convgeneratedcpp.h>
       
    24 
       
    25 #define ARRAY_LENGTH(aArray) (sizeof(aArray)/sizeof((aArray)[0]))
       
    26 
       
    27 #pragma warning (disable: 4049) // compiler limit : terminating line number emission
       
    28 
       
    29 _LIT8(KLit8ReplacementForUnconvertibleUnicodeCharacters, "\x1a");
       
    30 
       
    31 GLDEF_C const TDesC8& ReplacementForUnconvertibleUnicodeCharacters_internal()
       
    32 	{
       
    33 	return KLit8ReplacementForUnconvertibleUnicodeCharacters;
       
    34 	}
       
    35 
       
    36 LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_foreignToUnicode_1[]=
       
    37 	{
       
    38 	0x20ac,
       
    39 	0x0081,
       
    40 	0x201a,
       
    41 	0x0192,
       
    42 	0x201e,
       
    43 	0x2026,
       
    44 	0x2020,
       
    45 	0x2021,
       
    46 	0x02c6,
       
    47 	0x2030,
       
    48 	0x0160,
       
    49 	0x2039,
       
    50 	0x0152,
       
    51 	0x008d,
       
    52 	0x008e,
       
    53 	0x008f,
       
    54 	0x0090,
       
    55 	0x2018,
       
    56 	0x2019,
       
    57 	0x201c,
       
    58 	0x201d,
       
    59 	0x2022,
       
    60 	0x2013,
       
    61 	0x2014,
       
    62 	0x02dc,
       
    63 	0x2122,
       
    64 	0x0161,
       
    65 	0x203a,
       
    66 	0x0153,
       
    67 	0x009d,
       
    68 	0x009e,
       
    69 	0x0178,
       
    70 	0x00a0,
       
    71 	0x00a1,
       
    72 	0x00a2,
       
    73 	0x00a3,
       
    74 	0x00a4,
       
    75 	0x00a5,
       
    76 	0x00a6,
       
    77 	0x00a7,
       
    78 	0x00a8,
       
    79 	0x00a9,
       
    80 	0x00aa,
       
    81 	0x00ab,
       
    82 	0x00ac,
       
    83 	0x00ad,
       
    84 	0x00ae,
       
    85 	0x00af,
       
    86 	0x00b0,
       
    87 	0x00b1,
       
    88 	0x00b2,
       
    89 	0x00b3,
       
    90 	0x00b4,
       
    91 	0x00b5,
       
    92 	0x00b6,
       
    93 	0x00b7,
       
    94 	0x00b8,
       
    95 	0x00b9,
       
    96 	0x00ba,
       
    97 	0x00bb,
       
    98 	0x00bc,
       
    99 	0x00bd,
       
   100 	0x00be,
       
   101 	0x00bf,
       
   102 	0x00c0,
       
   103 	0x00c1,
       
   104 	0x00c2,
       
   105 	0x00c3,
       
   106 	0x00c4,
       
   107 	0x00c5,
       
   108 	0x00c6,
       
   109 	0x00c7,
       
   110 	0x00c8,
       
   111 	0x00c9,
       
   112 	0x00ca,
       
   113 	0x00cb,
       
   114 	0x00cc,
       
   115 	0x00cd,
       
   116 	0x00ce,
       
   117 	0x00cf,
       
   118 	0x011e,
       
   119 	0x00d1,
       
   120 	0x00d2,
       
   121 	0x00d3,
       
   122 	0x00d4,
       
   123 	0x00d5,
       
   124 	0x00d6,
       
   125 	0x00d7,
       
   126 	0x00d8,
       
   127 	0x00d9,
       
   128 	0x00da,
       
   129 	0x00db,
       
   130 	0x00dc,
       
   131 	0x0130,
       
   132 	0x015e,
       
   133 	0x00df,
       
   134 	0x00e0,
       
   135 	0x00e1,
       
   136 	0x00e2,
       
   137 	0x00e3,
       
   138 	0x00e4,
       
   139 	0x00e5,
       
   140 	0x00e6,
       
   141 	0x00e7,
       
   142 	0x00e8,
       
   143 	0x00e9,
       
   144 	0x00ea,
       
   145 	0x00eb,
       
   146 	0x00ec,
       
   147 	0x00ed,
       
   148 	0x00ee,
       
   149 	0x00ef,
       
   150 	0x011f,
       
   151 	0x00f1,
       
   152 	0x00f2,
       
   153 	0x00f3,
       
   154 	0x00f4,
       
   155 	0x00f5,
       
   156 	0x00f6,
       
   157 	0x00f7,
       
   158 	0x00f8,
       
   159 	0x00f9,
       
   160 	0x00fa,
       
   161 	0x00fb,
       
   162 	0x00fc,
       
   163 	0x0131,
       
   164 	0x015f,
       
   165 	0x00ff
       
   166 	};
       
   167 
       
   168 LOCAL_D const SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable16OfIndexedTables16::SKeyedEntry keyedTables16OfIndexedTables16_keyedEntries_foreignToUnicode_1[]=
       
   169 	{
       
   170 		{
       
   171 		0x80,
       
   172 		0xff,
       
   173 		keyedTables16OfIndexedTables16_indexedEntries_foreignToUnicode_1
       
   174 		}
       
   175 	};
       
   176 
       
   177 LOCAL_D const SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry keyedTable1616_unicodeToForeign_1[]=
       
   178 	{
       
   179 		{
       
   180 		0x0081,
       
   181 		0x81
       
   182 		},
       
   183 		{
       
   184 		0x008d,
       
   185 		0x8d
       
   186 		},
       
   187 		{
       
   188 		0x008e,
       
   189 		0x8e
       
   190 		},
       
   191 		{
       
   192 		0x008f,
       
   193 		0x8f
       
   194 		},
       
   195 		{
       
   196 		0x0090,
       
   197 		0x90
       
   198 		},
       
   199 		{
       
   200 		0x009d,
       
   201 		0x9d
       
   202 		},
       
   203 		{
       
   204 		0x009e,
       
   205 		0x9e
       
   206 		},
       
   207 		{
       
   208 		0x00ff,
       
   209 		0xff
       
   210 		}
       
   211 	};
       
   212 
       
   213 LOCAL_D const SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry keyedTable1616_unicodeToForeign_2[]=
       
   214 	{
       
   215 		{
       
   216 		0x011e,
       
   217 		0xd0
       
   218 		},
       
   219 		{
       
   220 		0x011f,
       
   221 		0xf0
       
   222 		},
       
   223 		{
       
   224 		0x0130,
       
   225 		0xdd
       
   226 		},
       
   227 		{
       
   228 		0x0131,
       
   229 		0xfd
       
   230 		},
       
   231 		{
       
   232 		0x0152,
       
   233 		0x8c
       
   234 		},
       
   235 		{
       
   236 		0x0153,
       
   237 		0x9c
       
   238 		},
       
   239 		{
       
   240 		0x015e,
       
   241 		0xde
       
   242 		},
       
   243 		{
       
   244 		0x015f,
       
   245 		0xfe
       
   246 		},
       
   247 		{
       
   248 		0x0160,
       
   249 		0x8a
       
   250 		},
       
   251 		{
       
   252 		0x0161,
       
   253 		0x9a
       
   254 		},
       
   255 		{
       
   256 		0x0178,
       
   257 		0x9f
       
   258 		},
       
   259 		{
       
   260 		0x0192,
       
   261 		0x83
       
   262 		},
       
   263 		{
       
   264 		0x02c6,
       
   265 		0x88
       
   266 		},
       
   267 		{
       
   268 		0x02dc,
       
   269 		0x98
       
   270 		},
       
   271 		{
       
   272 		0x2013,
       
   273 		0x96
       
   274 		},
       
   275 		{
       
   276 		0x2014,
       
   277 		0x97
       
   278 		},
       
   279 		{
       
   280 		0x2018,
       
   281 		0x91
       
   282 		},
       
   283 		{
       
   284 		0x2019,
       
   285 		0x92
       
   286 		},
       
   287 		{
       
   288 		0x201a,
       
   289 		0x82
       
   290 		},
       
   291 		{
       
   292 		0x201c,
       
   293 		0x93
       
   294 		},
       
   295 		{
       
   296 		0x201d,
       
   297 		0x94
       
   298 		},
       
   299 		{
       
   300 		0x201e,
       
   301 		0x84
       
   302 		},
       
   303 		{
       
   304 		0x2020,
       
   305 		0x86
       
   306 		},
       
   307 		{
       
   308 		0x2021,
       
   309 		0x87
       
   310 		},
       
   311 		{
       
   312 		0x2022,
       
   313 		0x95
       
   314 		},
       
   315 		{
       
   316 		0x2026,
       
   317 		0x85
       
   318 		},
       
   319 		{
       
   320 		0x2030,
       
   321 		0x89
       
   322 		},
       
   323 		{
       
   324 		0x2039,
       
   325 		0x8b
       
   326 		},
       
   327 		{
       
   328 		0x203a,
       
   329 		0x9b
       
   330 		},
       
   331 		{
       
   332 		0x20ac,
       
   333 		0x80
       
   334 		},
       
   335 		{
       
   336 		0x2122,
       
   337 		0x99
       
   338 		}
       
   339 	};
       
   340 
       
   341 LOCAL_D const SCnvConversionData::SVariableByteData::SRange foreignVariableByteDataRanges[]=
       
   342 	{
       
   343 		{
       
   344 		0x00,
       
   345 		0xff,
       
   346 		0,
       
   347 		0
       
   348 		}
       
   349 	};
       
   350 
       
   351 LOCAL_D const SCnvConversionData::SOneDirectionData::SRange foreignToUnicodeDataRanges[]=
       
   352 	{
       
   353 		{
       
   354 		0x00,
       
   355 		0x7f,
       
   356 		SCnvConversionData::SOneDirectionData::SRange::EDirect,
       
   357 		0,
       
   358 		0,
       
   359 			{
       
   360 			0,
       
   361 			0
       
   362 			}
       
   363 		},
       
   364 		{
       
   365 		0x80,
       
   366 		0xff,
       
   367 		SCnvConversionData::SOneDirectionData::SRange::EKeyedTable16OfIndexedTables16,
       
   368 		0,
       
   369 		0,
       
   370 			{
       
   371 			STATIC_CAST(TUint, ARRAY_LENGTH(keyedTables16OfIndexedTables16_keyedEntries_foreignToUnicode_1)),
       
   372 			REINTERPRET_CAST(TUint, CONST_CAST( SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable16OfIndexedTables16::SKeyedEntry*, keyedTables16OfIndexedTables16_keyedEntries_foreignToUnicode_1))
       
   373 			}
       
   374 		}
       
   375 	};
       
   376 
       
   377 LOCAL_D const SCnvConversionData::SOneDirectionData::SRange unicodeToForeignDataRanges[]=
       
   378 	{
       
   379 		{
       
   380 		0x0000,
       
   381 		0x007f,
       
   382 		SCnvConversionData::SOneDirectionData::SRange::EDirect,
       
   383 		1,
       
   384 		0,
       
   385 			{
       
   386 			0,
       
   387 			0
       
   388 			}
       
   389 		},
       
   390 		{
       
   391 		0x00a0,
       
   392 		0x00cf,
       
   393 		SCnvConversionData::SOneDirectionData::SRange::EDirect,
       
   394 		1,
       
   395 		0,
       
   396 			{
       
   397 			0,
       
   398 			0
       
   399 			}
       
   400 		},
       
   401 		{
       
   402 		0x00d1,
       
   403 		0x00dc,
       
   404 		SCnvConversionData::SOneDirectionData::SRange::EDirect,
       
   405 		1,
       
   406 		0,
       
   407 			{
       
   408 			0,
       
   409 			0
       
   410 			}
       
   411 		},
       
   412 		{
       
   413 		0x00df,
       
   414 		0x00ef,
       
   415 		SCnvConversionData::SOneDirectionData::SRange::EDirect,
       
   416 		1,
       
   417 		0,
       
   418 			{
       
   419 			0,
       
   420 			0
       
   421 			}
       
   422 		},
       
   423 		{
       
   424 		0x00f1,
       
   425 		0x00fc,
       
   426 		SCnvConversionData::SOneDirectionData::SRange::EDirect,
       
   427 		1,
       
   428 		0,
       
   429 			{
       
   430 			0,
       
   431 			0
       
   432 			}
       
   433 		},
       
   434 		{
       
   435 		0x0081,
       
   436 		0x00ff,
       
   437 		SCnvConversionData::SOneDirectionData::SRange::EKeyedTable1616,
       
   438 		1,
       
   439 		0,
       
   440 			{
       
   441 			STATIC_CAST(TUint, ARRAY_LENGTH(keyedTable1616_unicodeToForeign_1)),
       
   442 			REINTERPRET_CAST(TUint, CONST_CAST( SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry*, keyedTable1616_unicodeToForeign_1))
       
   443 			}
       
   444 		},
       
   445 		{
       
   446 		0x011e,
       
   447 		0x2122,
       
   448 		SCnvConversionData::SOneDirectionData::SRange::EKeyedTable1616,
       
   449 		1,
       
   450 		0,
       
   451 			{
       
   452 			STATIC_CAST(TUint, ARRAY_LENGTH(keyedTable1616_unicodeToForeign_2)),
       
   453 			REINTERPRET_CAST(TUint, CONST_CAST( SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry*, keyedTable1616_unicodeToForeign_2))
       
   454 			}
       
   455 		}
       
   456 	};
       
   457 
       
   458 GLDEF_D const SCnvConversionData conversionData=
       
   459 	{
       
   460 	SCnvConversionData::EFixedBigEndian,
       
   461 		{
       
   462 		ARRAY_LENGTH(foreignVariableByteDataRanges),
       
   463 		foreignVariableByteDataRanges
       
   464 		},
       
   465 		{
       
   466 		ARRAY_LENGTH(foreignToUnicodeDataRanges),
       
   467 		foreignToUnicodeDataRanges
       
   468 		},
       
   469 		{
       
   470 		ARRAY_LENGTH(unicodeToForeignDataRanges),
       
   471 		unicodeToForeignDataRanges
       
   472 		},
       
   473 	NULL,
       
   474 	NULL
       
   475 	};
       
   476