charconvfw/Charconvplugin/src/G_WIN1257.cpp
changeset 0 1fb32624e06b
child 16 56cd22a7a1cb
equal deleted inserted replaced
-1:000000000000 0:1fb32624e06b
       
     1 /*
       
     2 * Copyright (c) 1257 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 
       
    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 	0x0083,
       
    42 	0x201e,
       
    43 	0x2026,
       
    44 	0x2020,
       
    45 	0x2021,
       
    46 	0x0088,
       
    47 	0x2030,
       
    48 	0x008a,
       
    49 	0x2039,
       
    50 	0x008c,
       
    51 	0x00a8,
       
    52 	0x02c7,
       
    53 	0x00b8,
       
    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 	0x00af,
       
    68 	0x02db,
       
    69 	0x009f,
       
    70 	0x00a0,
       
    71 	0x00a1,
       
    72 	0x00a2,
       
    73 	0x00a3,
       
    74 	0x00a4,
       
    75 	0x00a5,
       
    76 	0x00a6,
       
    77 	0x00a7,
       
    78 	0x00d8,
       
    79 	0x00a9,
       
    80 	0x0156,
       
    81 	0x00ab,
       
    82 	0x00ac,
       
    83 	0x00ad,
       
    84 	0x00ae,
       
    85 	0x00c6,
       
    86 	0x00b0,
       
    87 	0x00b1,
       
    88 	0x00b2,
       
    89 	0x00b3,
       
    90 	0x00b4,
       
    91 	0x00b5,
       
    92 	0x00b6,
       
    93 	0x00b7,
       
    94 	0x00f8,
       
    95 	0x00b9,
       
    96 	0x0157,
       
    97 	0x00bb,
       
    98 	0x00bc,
       
    99 	0x00bd,
       
   100 	0x00be,
       
   101 	0x00e6,
       
   102 	0x0104,
       
   103 	0x012e,
       
   104 	0x0100,
       
   105 	0x0106,
       
   106 	0x00c4,
       
   107 	0x00c5,
       
   108 	0x0118,
       
   109 	0x0112,
       
   110 	0x010c,
       
   111 	0x00c9,
       
   112 	0x0179,
       
   113 	0x0116,
       
   114 	0x0122,
       
   115 	0x0136,
       
   116 	0x012a,
       
   117 	0x013b,
       
   118 	0x0160,
       
   119 	0x0143,
       
   120 	0x0145,
       
   121 	0x00d3,
       
   122 	0x014c,
       
   123 	0x00d5,
       
   124 	0x00d6,
       
   125 	0x00d7,
       
   126 	0x0172,
       
   127 	0x0141,
       
   128 	0x015a,
       
   129 	0x016a,
       
   130 	0x00dc,
       
   131 	0x017b,
       
   132 	0x017d,
       
   133 	0x00df,
       
   134 	0x0105,
       
   135 	0x012f,
       
   136 	0x0101,
       
   137 	0x0107,
       
   138 	0x00e4,
       
   139 	0x00e5,
       
   140 	0x0119,
       
   141 	0x0113,
       
   142 	0x010d,
       
   143 	0x00e9,
       
   144 	0x017a,
       
   145 	0x0117,
       
   146 	0x0123,
       
   147 	0x0137,
       
   148 	0x012b,
       
   149 	0x013c,
       
   150 	0x0161,
       
   151 	0x0144,
       
   152 	0x0146,
       
   153 	0x00f3,
       
   154 	0x014d,
       
   155 	0x00f5,
       
   156 	0x00f6,
       
   157 	0x00f7,
       
   158 	0x0173,
       
   159 	0x0142,
       
   160 	0x015b,
       
   161 	0x016b,
       
   162 	0x00fc,
       
   163 	0x017c,
       
   164 	0x017e,
       
   165 	0x02d9
       
   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 		0x0083,
       
   185 		0x83
       
   186 		},
       
   187 		{
       
   188 		0x0088,
       
   189 		0x88
       
   190 		},
       
   191 		{
       
   192 		0x008a,
       
   193 		0x8a
       
   194 		},
       
   195 		{
       
   196 		0x008c,
       
   197 		0x8c
       
   198 		},
       
   199 		{
       
   200 		0x0090,
       
   201 		0x90
       
   202 		},
       
   203 		{
       
   204 		0x0098,
       
   205 		0x98
       
   206 		},
       
   207 		{
       
   208 		0x009a,
       
   209 		0x9a
       
   210 		},
       
   211 		{
       
   212 		0x009c,
       
   213 		0x9c
       
   214 		},
       
   215 		{
       
   216 		0x009f,
       
   217 		0x9f
       
   218 		},
       
   219 		{
       
   220 		0x00a0,
       
   221 		0xa0
       
   222 		},
       
   223 		{
       
   224 		0x00a1,
       
   225 		0xa1
       
   226 		},
       
   227 		{
       
   228 		0x00a2,
       
   229 		0xa2
       
   230 		},
       
   231 		{
       
   232 		0x00a3,
       
   233 		0xa3
       
   234 		},
       
   235 		{
       
   236 		0x00a4,
       
   237 		0xa4
       
   238 		},
       
   239 		{
       
   240 		0x00a5,
       
   241 		0xa5
       
   242 		},
       
   243 		{
       
   244 		0x00a6,
       
   245 		0xa6
       
   246 		},
       
   247 		{
       
   248 		0x00a7,
       
   249 		0xa7
       
   250 		},
       
   251 		{
       
   252 		0x00a8,
       
   253 		0x8d
       
   254 		},
       
   255 		{
       
   256 		0x00a9,
       
   257 		0xa9
       
   258 		},
       
   259 		{
       
   260 		0x00ab,
       
   261 		0xab
       
   262 		},
       
   263 		{
       
   264 		0x00ac,
       
   265 		0xac
       
   266 		},
       
   267 		{
       
   268 		0x00ad,
       
   269 		0xad
       
   270 		},
       
   271 		{
       
   272 		0x00ae,
       
   273 		0xae
       
   274 		},
       
   275 		{
       
   276 		0x00af,
       
   277 		0x9d
       
   278 		},
       
   279 		{
       
   280 		0x00b0,
       
   281 		0xb0
       
   282 		},
       
   283 		{
       
   284 		0x00b1,
       
   285 		0xb1
       
   286 		},
       
   287 		{
       
   288 		0x00b2,
       
   289 		0xb2
       
   290 		},
       
   291 		{
       
   292 		0x00b3,
       
   293 		0xb3
       
   294 		},
       
   295 		{
       
   296 		0x00b4,
       
   297 		0xb4
       
   298 		},
       
   299 		{
       
   300 		0x00b5,
       
   301 		0xb5
       
   302 		},
       
   303 		{
       
   304 		0x00b6,
       
   305 		0xb6
       
   306 		},
       
   307 		{
       
   308 		0x00b7,
       
   309 		0xb7
       
   310 		},
       
   311 		{
       
   312 		0x00b8,
       
   313 		0x8f
       
   314 		},
       
   315 		{
       
   316 		0x00b9,
       
   317 		0xb9
       
   318 		},
       
   319 		{
       
   320 		0x00bb,
       
   321 		0xbb
       
   322 		},
       
   323 		{
       
   324 		0x00bc,
       
   325 		0xbc
       
   326 		},
       
   327 		{
       
   328 		0x00bd,
       
   329 		0xbd
       
   330 		},
       
   331 		{
       
   332 		0x00be,
       
   333 		0xbe
       
   334 		},
       
   335 		{
       
   336 		0x00c4,
       
   337 		0xc4
       
   338 		},
       
   339 		{
       
   340 		0x00c5,
       
   341 		0xc5
       
   342 		},
       
   343 		{
       
   344 		0x00c6,
       
   345 		0xaf
       
   346 		},
       
   347 		{
       
   348 		0x00c9,
       
   349 		0xc9
       
   350 		},
       
   351 		{
       
   352 		0x00d3,
       
   353 		0xd3
       
   354 		},
       
   355 		{
       
   356 		0x00d5,
       
   357 		0xd5
       
   358 		},
       
   359 		{
       
   360 		0x00d6,
       
   361 		0xd6
       
   362 		},
       
   363 		{
       
   364 		0x00d7,
       
   365 		0xd7
       
   366 		},
       
   367 		{
       
   368 		0x00d8,
       
   369 		0xa8
       
   370 		},
       
   371 		{
       
   372 		0x00dc,
       
   373 		0xdc
       
   374 		},
       
   375 		{
       
   376 		0x00df,
       
   377 		0xdf
       
   378 		},
       
   379 		{
       
   380 		0x00e4,
       
   381 		0xe4
       
   382 		},
       
   383 		{
       
   384 		0x00e5,
       
   385 		0xe5
       
   386 		},
       
   387 		{
       
   388 		0x00e6,
       
   389 		0xbf
       
   390 		},
       
   391 		{
       
   392 		0x00e9,
       
   393 		0xe9
       
   394 		},
       
   395 		{
       
   396 		0x00f3,
       
   397 		0xf3
       
   398 		},
       
   399 		{
       
   400 		0x00f5,
       
   401 		0xf5
       
   402 		},
       
   403 		{
       
   404 		0x00f6,
       
   405 		0xf6
       
   406 		},
       
   407 		{
       
   408 		0x00f7,
       
   409 		0xf7
       
   410 		},
       
   411 		{
       
   412 		0x00f8,
       
   413 		0xb8
       
   414 		},
       
   415 		{
       
   416 		0x00fc,
       
   417 		0xfc
       
   418 		},
       
   419 		{
       
   420 		0x0100,
       
   421 		0xc2
       
   422 		},
       
   423 		{
       
   424 		0x0101,
       
   425 		0xe2
       
   426 		},
       
   427 		{
       
   428 		0x0104,
       
   429 		0xc0
       
   430 		},
       
   431 		{
       
   432 		0x0105,
       
   433 		0xe0
       
   434 		},
       
   435 		{
       
   436 		0x0106,
       
   437 		0xc3
       
   438 		},
       
   439 		{
       
   440 		0x0107,
       
   441 		0xe3
       
   442 		},
       
   443 		{
       
   444 		0x010c,
       
   445 		0xc8
       
   446 		},
       
   447 		{
       
   448 		0x010d,
       
   449 		0xe8
       
   450 		},
       
   451 		{
       
   452 		0x0112,
       
   453 		0xc7
       
   454 		},
       
   455 		{
       
   456 		0x0113,
       
   457 		0xe7
       
   458 		},
       
   459 		{
       
   460 		0x0116,
       
   461 		0xcb
       
   462 		},
       
   463 		{
       
   464 		0x0117,
       
   465 		0xeb
       
   466 		},
       
   467 		{
       
   468 		0x0118,
       
   469 		0xc6
       
   470 		},
       
   471 		{
       
   472 		0x0119,
       
   473 		0xe6
       
   474 		},
       
   475 		{
       
   476 		0x0122,
       
   477 		0xcc
       
   478 		},
       
   479 		{
       
   480 		0x0123,
       
   481 		0xec
       
   482 		},
       
   483 		{
       
   484 		0x012a,
       
   485 		0xce
       
   486 		},
       
   487 		{
       
   488 		0x012b,
       
   489 		0xee
       
   490 		},
       
   491 		{
       
   492 		0x012e,
       
   493 		0xc1
       
   494 		},
       
   495 		{
       
   496 		0x012f,
       
   497 		0xe1
       
   498 		},
       
   499 		{
       
   500 		0x0136,
       
   501 		0xcd
       
   502 		},
       
   503 		{
       
   504 		0x0137,
       
   505 		0xed
       
   506 		},
       
   507 		{
       
   508 		0x013b,
       
   509 		0xcf
       
   510 		},
       
   511 		{
       
   512 		0x013c,
       
   513 		0xef
       
   514 		},
       
   515 		{
       
   516 		0x0141,
       
   517 		0xd9
       
   518 		},
       
   519 		{
       
   520 		0x0142,
       
   521 		0xf9
       
   522 		},
       
   523 		{
       
   524 		0x0143,
       
   525 		0xd1
       
   526 		},
       
   527 		{
       
   528 		0x0144,
       
   529 		0xf1
       
   530 		},
       
   531 		{
       
   532 		0x0145,
       
   533 		0xd2
       
   534 		},
       
   535 		{
       
   536 		0x0146,
       
   537 		0xf2
       
   538 		},
       
   539 		{
       
   540 		0x014c,
       
   541 		0xd4
       
   542 		},
       
   543 		{
       
   544 		0x014d,
       
   545 		0xf4
       
   546 		},
       
   547 		{
       
   548 		0x0156,
       
   549 		0xaa
       
   550 		},
       
   551 		{
       
   552 		0x0157,
       
   553 		0xba
       
   554 		},
       
   555 		{
       
   556 		0x015a,
       
   557 		0xda
       
   558 		},
       
   559 		{
       
   560 		0x015b,
       
   561 		0xfa
       
   562 		},
       
   563 		{
       
   564 		0x0160,
       
   565 		0xd0
       
   566 		},
       
   567 		{
       
   568 		0x0161,
       
   569 		0xf0
       
   570 		},
       
   571 		{
       
   572 		0x016a,
       
   573 		0xdb
       
   574 		},
       
   575 		{
       
   576 		0x016b,
       
   577 		0xfb
       
   578 		},
       
   579 		{
       
   580 		0x0172,
       
   581 		0xd8
       
   582 		},
       
   583 		{
       
   584 		0x0173,
       
   585 		0xf8
       
   586 		},
       
   587 		{
       
   588 		0x0179,
       
   589 		0xca
       
   590 		},
       
   591 		{
       
   592 		0x017a,
       
   593 		0xea
       
   594 		},
       
   595 		{
       
   596 		0x017b,
       
   597 		0xdd
       
   598 		},
       
   599 		{
       
   600 		0x017c,
       
   601 		0xfd
       
   602 		},
       
   603 		{
       
   604 		0x017d,
       
   605 		0xde
       
   606 		},
       
   607 		{
       
   608 		0x017e,
       
   609 		0xfe
       
   610 		},
       
   611 		{
       
   612 		0x02c7,
       
   613 		0x8e
       
   614 		},
       
   615 		{
       
   616 		0x02d9,
       
   617 		0xff
       
   618 		},
       
   619 		{
       
   620 		0x02db,
       
   621 		0x9e
       
   622 		},
       
   623 		{
       
   624 		0x2013,
       
   625 		0x96
       
   626 		},
       
   627 		{
       
   628 		0x2014,
       
   629 		0x97
       
   630 		},
       
   631 		{
       
   632 		0x2018,
       
   633 		0x91
       
   634 		},
       
   635 		{
       
   636 		0x2019,
       
   637 		0x92
       
   638 		},
       
   639 		{
       
   640 		0x201a,
       
   641 		0x82
       
   642 		},
       
   643 		{
       
   644 		0x201c,
       
   645 		0x93
       
   646 		},
       
   647 		{
       
   648 		0x201d,
       
   649 		0x94
       
   650 		},
       
   651 		{
       
   652 		0x201e,
       
   653 		0x84
       
   654 		},
       
   655 		{
       
   656 		0x2020,
       
   657 		0x86
       
   658 		},
       
   659 		{
       
   660 		0x2021,
       
   661 		0x87
       
   662 		},
       
   663 		{
       
   664 		0x2022,
       
   665 		0x95
       
   666 		},
       
   667 		{
       
   668 		0x2026,
       
   669 		0x85
       
   670 		},
       
   671 		{
       
   672 		0x2030,
       
   673 		0x89
       
   674 		},
       
   675 		{
       
   676 		0x2039,
       
   677 		0x8b
       
   678 		},
       
   679 		{
       
   680 		0x203a,
       
   681 		0x9b
       
   682 		},
       
   683 		{
       
   684 		0x20ac,
       
   685 		0x80
       
   686 		},
       
   687 		{
       
   688 		0x2122,
       
   689 		0x99
       
   690 		}
       
   691 	};
       
   692 
       
   693 LOCAL_D const SCnvConversionData::SVariableByteData::SRange foreignVariableByteDataRanges[]=
       
   694 	{
       
   695 		{
       
   696 		0x00,
       
   697 		0xff,
       
   698 		0,
       
   699 		0
       
   700 		}
       
   701 	};
       
   702 
       
   703 LOCAL_D const SCnvConversionData::SOneDirectionData::SRange foreignToUnicodeDataRanges[]=
       
   704 	{
       
   705 		{
       
   706 		0x00,
       
   707 		0x7f,
       
   708 		SCnvConversionData::SOneDirectionData::SRange::EDirect,
       
   709 		0,
       
   710 		0,
       
   711 			{
       
   712 			0,
       
   713 			0
       
   714 			}
       
   715 		},
       
   716 		{
       
   717 		0x80,
       
   718 		0xff,
       
   719 		SCnvConversionData::SOneDirectionData::SRange::EKeyedTable16OfIndexedTables16,
       
   720 		0,
       
   721 		0,
       
   722 			{
       
   723 			STATIC_CAST(TUint, ARRAY_LENGTH(keyedTables16OfIndexedTables16_keyedEntries_foreignToUnicode_1)),
       
   724 			REINTERPRET_CAST(TUint, CONST_CAST( SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable16OfIndexedTables16::SKeyedEntry*, keyedTables16OfIndexedTables16_keyedEntries_foreignToUnicode_1))
       
   725 			}
       
   726 		}
       
   727 	};
       
   728 
       
   729 LOCAL_D const SCnvConversionData::SOneDirectionData::SRange unicodeToForeignDataRanges[]=
       
   730 	{
       
   731 		{
       
   732 		0x0000,
       
   733 		0x007f,
       
   734 		SCnvConversionData::SOneDirectionData::SRange::EDirect,
       
   735 		1,
       
   736 		0,
       
   737 			{
       
   738 			0,
       
   739 			0
       
   740 			}
       
   741 		},
       
   742 		{
       
   743 		0x0081,
       
   744 		0x2122,
       
   745 		SCnvConversionData::SOneDirectionData::SRange::EKeyedTable1616,
       
   746 		1,
       
   747 		0,
       
   748 			{
       
   749 			STATIC_CAST(TUint, ARRAY_LENGTH(keyedTable1616_unicodeToForeign_1)),
       
   750 			REINTERPRET_CAST(TUint, CONST_CAST( SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry*, keyedTable1616_unicodeToForeign_1))
       
   751 			}
       
   752 		}
       
   753 	};
       
   754 
       
   755 GLDEF_D const SCnvConversionData conversionData=
       
   756 	{
       
   757 	SCnvConversionData::EFixedBigEndian,
       
   758 		{
       
   759 		ARRAY_LENGTH(foreignVariableByteDataRanges),
       
   760 		foreignVariableByteDataRanges
       
   761 		},
       
   762 		{
       
   763 		ARRAY_LENGTH(foreignToUnicodeDataRanges),
       
   764 		foreignToUnicodeDataRanges
       
   765 		},
       
   766 		{
       
   767 		ARRAY_LENGTH(unicodeToForeignDataRanges),
       
   768 		unicodeToForeignDataRanges
       
   769 		},
       
   770 	NULL,
       
   771 	NULL
       
   772 	};
       
   773