charconvfw/Charconvplugin/src/G_WIN1253.cpp
changeset 32 8b9155204a54
equal deleted inserted replaced
31:b9ad20498fb4 32:8b9155204a54
       
     1 /*
       
     2 * Copyright (c) 1253 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 	0x0088,
       
    47 	0x2030,
       
    48 	0x008a,
       
    49 	0x2039,
       
    50 	0x008c,
       
    51 	0x008d,
       
    52 	0x008e,
       
    53 	0x008f,
       
    54 	0x0090,
       
    55 	0x2018,
       
    56 	0x2019,
       
    57 	0x201c,
       
    58 	0x201d,
       
    59 	0x2022,
       
    60 	0x2013,
       
    61 	0x2014,
       
    62 	0x0098,
       
    63 	0x2122,
       
    64 	0x009a,
       
    65 	0x203a,
       
    66 	0x009c,
       
    67 	0x009d,
       
    68 	0x009e,
       
    69 	0x009f,
       
    70 	0x00a0,
       
    71 	0x0385,
       
    72 	0x0386,
       
    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 	0x2015,
       
    86 	0x00b0,
       
    87 	0x00b1,
       
    88 	0x00b2,
       
    89 	0x00b3,
       
    90 	0x0384,
       
    91 	0x00b5,
       
    92 	0x00b6,
       
    93 	0x00b7,
       
    94 	0x0388,
       
    95 	0x0389,
       
    96 	0x038a,
       
    97 	0x00bb,
       
    98 	0x038c,
       
    99 	0x00bd,
       
   100 	0x038e,
       
   101 	0x038f,
       
   102 	0x0390,
       
   103 	0x0391,
       
   104 	0x0392,
       
   105 	0x0393,
       
   106 	0x0394,
       
   107 	0x0395,
       
   108 	0x0396,
       
   109 	0x0397,
       
   110 	0x0398,
       
   111 	0x0399,
       
   112 	0x039a,
       
   113 	0x039b,
       
   114 	0x039c,
       
   115 	0x039d,
       
   116 	0x039e,
       
   117 	0x039f,
       
   118 	0x03a0,
       
   119 	0x03a1,
       
   120 	0x00d2,
       
   121 	0x03a3,
       
   122 	0x03a4,
       
   123 	0x03a5,
       
   124 	0x03a6,
       
   125 	0x03a7,
       
   126 	0x03a8,
       
   127 	0x03a9,
       
   128 	0x03aa,
       
   129 	0x03ab,
       
   130 	0x03ac,
       
   131 	0x03ad,
       
   132 	0x03ae,
       
   133 	0x03af,
       
   134 	0x03b0,
       
   135 	0x03b1,
       
   136 	0x03b2,
       
   137 	0x03b3,
       
   138 	0x03b4,
       
   139 	0x03b5,
       
   140 	0x03b6,
       
   141 	0x03b7,
       
   142 	0x03b8,
       
   143 	0x03b9,
       
   144 	0x03ba,
       
   145 	0x03bb,
       
   146 	0x03bc,
       
   147 	0x03bd,
       
   148 	0x03be,
       
   149 	0x03bf,
       
   150 	0x03c0,
       
   151 	0x03c1,
       
   152 	0x03c2,
       
   153 	0x03c3,
       
   154 	0x03c4,
       
   155 	0x03c5,
       
   156 	0x03c6,
       
   157 	0x03c7,
       
   158 	0x03c8,
       
   159 	0x03c9,
       
   160 	0x03ca,
       
   161 	0x03cb,
       
   162 	0x03cc,
       
   163 	0x03cd,
       
   164 	0x03ce,
       
   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 		0x0088,
       
   185 		0x88
       
   186 		},
       
   187 		{
       
   188 		0x008a,
       
   189 		0x8a
       
   190 		},
       
   191 		{
       
   192 		0x008c,
       
   193 		0x8c
       
   194 		},
       
   195 		{
       
   196 		0x008d,
       
   197 		0x8d
       
   198 		},
       
   199 		{
       
   200 		0x008e,
       
   201 		0x8e
       
   202 		},
       
   203 		{
       
   204 		0x008f,
       
   205 		0x8f
       
   206 		},
       
   207 		{
       
   208 		0x0090,
       
   209 		0x90
       
   210 		},
       
   211 		{
       
   212 		0x0098,
       
   213 		0x98
       
   214 		},
       
   215 		{
       
   216 		0x009a,
       
   217 		0x9a
       
   218 		},
       
   219 		{
       
   220 		0x009c,
       
   221 		0x9c
       
   222 		},
       
   223 		{
       
   224 		0x009d,
       
   225 		0x9d
       
   226 		},
       
   227 		{
       
   228 		0x009e,
       
   229 		0x9e
       
   230 		},
       
   231 		{
       
   232 		0x009f,
       
   233 		0x9f
       
   234 		},
       
   235 		{
       
   236 		0x00a0,
       
   237 		0xa0
       
   238 		},
       
   239 		{
       
   240 		0x00b0,
       
   241 		0xb0
       
   242 		},
       
   243 		{
       
   244 		0x00b1,
       
   245 		0xb1
       
   246 		},
       
   247 		{
       
   248 		0x00b2,
       
   249 		0xb2
       
   250 		},
       
   251 		{
       
   252 		0x00b3,
       
   253 		0xb3
       
   254 		},
       
   255 		{
       
   256 		0x00b5,
       
   257 		0xb5
       
   258 		},
       
   259 		{
       
   260 		0x00b6,
       
   261 		0xb6
       
   262 		},
       
   263 		{
       
   264 		0x00b7,
       
   265 		0xb7
       
   266 		},
       
   267 		{
       
   268 		0x00bb,
       
   269 		0xbb
       
   270 		},
       
   271 		{
       
   272 		0x00bd,
       
   273 		0xbd
       
   274 		},
       
   275 		{
       
   276 		0x00d2,
       
   277 		0xd2
       
   278 		},
       
   279 		{
       
   280 		0x00ff,
       
   281 		0xff
       
   282 		},
       
   283 		{
       
   284 		0x0192,
       
   285 		0x83
       
   286 		}
       
   287 	};
       
   288 
       
   289 LOCAL_D const SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry keyedTable1616_unicodeToForeign_2[]=
       
   290 	{
       
   291 		{
       
   292 		0x0384,
       
   293 		0xb4
       
   294 		},
       
   295 		{
       
   296 		0x0385,
       
   297 		0xa1
       
   298 		},
       
   299 		{
       
   300 		0x0386,
       
   301 		0xa2
       
   302 		},
       
   303 		{
       
   304 		0x0388,
       
   305 		0xb8
       
   306 		},
       
   307 		{
       
   308 		0x0389,
       
   309 		0xb9
       
   310 		},
       
   311 		{
       
   312 		0x038a,
       
   313 		0xba
       
   314 		},
       
   315 		{
       
   316 		0x038c,
       
   317 		0xbc
       
   318 		},
       
   319 		{
       
   320 		0x2013,
       
   321 		0x96
       
   322 		},
       
   323 		{
       
   324 		0x2014,
       
   325 		0x97
       
   326 		},
       
   327 		{
       
   328 		0x2015,
       
   329 		0xaf
       
   330 		},
       
   331 		{
       
   332 		0x2018,
       
   333 		0x91
       
   334 		},
       
   335 		{
       
   336 		0x2019,
       
   337 		0x92
       
   338 		},
       
   339 		{
       
   340 		0x201a,
       
   341 		0x82
       
   342 		},
       
   343 		{
       
   344 		0x201c,
       
   345 		0x93
       
   346 		},
       
   347 		{
       
   348 		0x201d,
       
   349 		0x94
       
   350 		},
       
   351 		{
       
   352 		0x201e,
       
   353 		0x84
       
   354 		},
       
   355 		{
       
   356 		0x2020,
       
   357 		0x86
       
   358 		},
       
   359 		{
       
   360 		0x2021,
       
   361 		0x87
       
   362 		},
       
   363 		{
       
   364 		0x2022,
       
   365 		0x95
       
   366 		},
       
   367 		{
       
   368 		0x2026,
       
   369 		0x85
       
   370 		},
       
   371 		{
       
   372 		0x2030,
       
   373 		0x89
       
   374 		},
       
   375 		{
       
   376 		0x2039,
       
   377 		0x8b
       
   378 		},
       
   379 		{
       
   380 		0x203a,
       
   381 		0x9b
       
   382 		},
       
   383 		{
       
   384 		0x20ac,
       
   385 		0x80
       
   386 		},
       
   387 		{
       
   388 		0x2122,
       
   389 		0x99
       
   390 		}
       
   391 	};
       
   392 
       
   393 LOCAL_D const SCnvConversionData::SVariableByteData::SRange foreignVariableByteDataRanges[]=
       
   394 	{
       
   395 		{
       
   396 		0x00,
       
   397 		0xff,
       
   398 		0,
       
   399 		0
       
   400 		}
       
   401 	};
       
   402 
       
   403 LOCAL_D const SCnvConversionData::SOneDirectionData::SRange foreignToUnicodeDataRanges[]=
       
   404 	{
       
   405 		{
       
   406 		0x00,
       
   407 		0x7f,
       
   408 		SCnvConversionData::SOneDirectionData::SRange::EDirect,
       
   409 		0,
       
   410 		0,
       
   411 			{
       
   412 			0,
       
   413 			0
       
   414 			}
       
   415 		},
       
   416 		{
       
   417 		0x80,
       
   418 		0xff,
       
   419 		SCnvConversionData::SOneDirectionData::SRange::EKeyedTable16OfIndexedTables16,
       
   420 		0,
       
   421 		0,
       
   422 			{
       
   423 			STATIC_CAST(TUint, ARRAY_LENGTH(keyedTables16OfIndexedTables16_keyedEntries_foreignToUnicode_1)),
       
   424 			REINTERPRET_CAST(TUint, CONST_CAST(SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable16OfIndexedTables16::SKeyedEntry*, keyedTables16OfIndexedTables16_keyedEntries_foreignToUnicode_1))
       
   425 			}
       
   426 		}
       
   427 	};
       
   428 
       
   429 LOCAL_D const SCnvConversionData::SOneDirectionData::SRange unicodeToForeignDataRanges[]=
       
   430 	{
       
   431 		{
       
   432 		0x0000,
       
   433 		0x007f,
       
   434 		SCnvConversionData::SOneDirectionData::SRange::EDirect,
       
   435 		1,
       
   436 		0,
       
   437 			{
       
   438 			0,
       
   439 			0
       
   440 			}
       
   441 		},
       
   442 		{
       
   443 		0x00a3,
       
   444 		0x00ae,
       
   445 		SCnvConversionData::SOneDirectionData::SRange::EDirect,
       
   446 		1,
       
   447 		0,
       
   448 			{
       
   449 			0,
       
   450 			0
       
   451 			}
       
   452 		},
       
   453 		{
       
   454 		0x038e,
       
   455 		0x03a1,
       
   456 		SCnvConversionData::SOneDirectionData::SRange::EOffset,
       
   457 		1,
       
   458 		0,
       
   459 			{
       
   460 			STATIC_CAST(TUint, -720),
       
   461 			0
       
   462 			}
       
   463 		},
       
   464 		{
       
   465 		0x03a3,
       
   466 		0x03ce,
       
   467 		SCnvConversionData::SOneDirectionData::SRange::EOffset,
       
   468 		1,
       
   469 		0,
       
   470 			{
       
   471 			STATIC_CAST(TUint, -720),
       
   472 			0
       
   473 			}
       
   474 		},
       
   475 		{
       
   476 		0x0081,
       
   477 		0x0192,
       
   478 		SCnvConversionData::SOneDirectionData::SRange::EKeyedTable1616,
       
   479 		1,
       
   480 		0,
       
   481 			{
       
   482 			STATIC_CAST(TUint, ARRAY_LENGTH(keyedTable1616_unicodeToForeign_1)),
       
   483 			REINTERPRET_CAST(TUint, CONST_CAST(SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry*, keyedTable1616_unicodeToForeign_1))
       
   484 			}
       
   485 		},
       
   486 		{
       
   487 		0x0384,
       
   488 		0x2122,
       
   489 		SCnvConversionData::SOneDirectionData::SRange::EKeyedTable1616,
       
   490 		1,
       
   491 		0,
       
   492 			{
       
   493 			STATIC_CAST(TUint, ARRAY_LENGTH(keyedTable1616_unicodeToForeign_2)),
       
   494 			REINTERPRET_CAST(TUint, CONST_CAST( SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry*,keyedTable1616_unicodeToForeign_2))
       
   495 			}
       
   496 		}
       
   497 	};
       
   498 
       
   499 GLDEF_D const SCnvConversionData conversionData=
       
   500 	{
       
   501 	SCnvConversionData::EFixedBigEndian,
       
   502 		{
       
   503 		ARRAY_LENGTH(foreignVariableByteDataRanges),
       
   504 		foreignVariableByteDataRanges
       
   505 		},
       
   506 		{
       
   507 		ARRAY_LENGTH(foreignToUnicodeDataRanges),
       
   508 		foreignToUnicodeDataRanges
       
   509 		},
       
   510 		{
       
   511 		ARRAY_LENGTH(unicodeToForeignDataRanges),
       
   512 		unicodeToForeignDataRanges
       
   513 		},
       
   514 	NULL,
       
   515 	NULL
       
   516 	};
       
   517