charconvfw/Charconvplugin/src/G_KOI8U.cpp
changeset 32 8b9155204a54
equal deleted inserted replaced
31:b9ad20498fb4 32:8b9155204a54
       
     1 /*
       
     2 * Copyright (c) 2004 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 SCnvConversionData::SOneDirectionData::SRange::UData::SIndexedTable16::SEntry indexedTable16_foreignToUnicode_1[]=
       
    37 	{
       
    38 		{
       
    39 		0x2500
       
    40 		},
       
    41 		{
       
    42 		0x2502
       
    43 		},
       
    44 		{
       
    45 		0x250c
       
    46 		},
       
    47 		{
       
    48 		0x2510
       
    49 		},
       
    50 		{
       
    51 		0x2514
       
    52 		},
       
    53 		{
       
    54 		0x2518
       
    55 		},
       
    56 		{
       
    57 		0x251c
       
    58 		},
       
    59 		{
       
    60 		0x2524
       
    61 		},
       
    62 		{
       
    63 		0x252c
       
    64 		},
       
    65 		{
       
    66 		0x2534
       
    67 		},
       
    68 		{
       
    69 		0x253c
       
    70 		},
       
    71 		{
       
    72 		0x2580
       
    73 		},
       
    74 		{
       
    75 		0x2584
       
    76 		},
       
    77 		{
       
    78 		0x2588
       
    79 		},
       
    80 		{
       
    81 		0x258c
       
    82 		},
       
    83 		{
       
    84 		0x2590
       
    85 		},
       
    86 		{
       
    87 		0x2591
       
    88 		},
       
    89 		{
       
    90 		0x2592
       
    91 		},
       
    92 		{
       
    93 		0x2593
       
    94 		},
       
    95 		{
       
    96 		0x2320
       
    97 		},
       
    98 		{
       
    99 		0x25a0
       
   100 		},
       
   101 		{
       
   102 		0x2219
       
   103 		},
       
   104 		{
       
   105 		0x221a
       
   106 		},
       
   107 		{
       
   108 		0x2248
       
   109 		},
       
   110 		{
       
   111 		0x2264
       
   112 		},
       
   113 		{
       
   114 		0x2265
       
   115 		},
       
   116 		{
       
   117 		0x00a0
       
   118 		},
       
   119 		{
       
   120 		0x2321
       
   121 		},
       
   122 		{
       
   123 		0x00b0
       
   124 		},
       
   125 		{
       
   126 		0x00b2
       
   127 		},
       
   128 		{
       
   129 		0x00b7
       
   130 		},
       
   131 		{
       
   132 		0x00f7
       
   133 		},
       
   134 		{
       
   135 		0x2550
       
   136 		},
       
   137 		{
       
   138 		0x2551
       
   139 		},
       
   140 		{
       
   141 		0x2552
       
   142 		},
       
   143 		{
       
   144 		0x0451
       
   145 		},
       
   146 		{
       
   147 		0x0454
       
   148 		},
       
   149 		{
       
   150 		0x2554
       
   151 		},
       
   152 		{
       
   153 		0x0456
       
   154 		},
       
   155 		{
       
   156 		0x0457
       
   157 		},
       
   158 		{
       
   159 		0x2557
       
   160 		},
       
   161 		{
       
   162 		0x2558
       
   163 		},
       
   164 		{
       
   165 		0x2559
       
   166 		},
       
   167 		{
       
   168 		0x255a
       
   169 		},
       
   170 		{
       
   171 		0x255b
       
   172 		},
       
   173 		{
       
   174 		0x0491
       
   175 		},
       
   176 		{
       
   177 		0x255d
       
   178 		},
       
   179 		{
       
   180 		0x255e
       
   181 		},
       
   182 		{
       
   183 		0x255f
       
   184 		},
       
   185 		{
       
   186 		0x2560
       
   187 		},
       
   188 		{
       
   189 		0x2561
       
   190 		},
       
   191 		{
       
   192 		0x0401
       
   193 		},
       
   194 		{
       
   195 		0x0404
       
   196 		},
       
   197 		{
       
   198 		0x2563
       
   199 		},
       
   200 		{
       
   201 		0x0406
       
   202 		},
       
   203 		{
       
   204 		0x0407
       
   205 		},
       
   206 		{
       
   207 		0x2566
       
   208 		},
       
   209 		{
       
   210 		0x2567
       
   211 		},
       
   212 		{
       
   213 		0x2568
       
   214 		},
       
   215 		{
       
   216 		0x2569
       
   217 		},
       
   218 		{
       
   219 		0x256a
       
   220 		},
       
   221 		{
       
   222 		0x0490
       
   223 		},
       
   224 		{
       
   225 		0x256c
       
   226 		},
       
   227 		{
       
   228 		0x00a9
       
   229 		},
       
   230 		{
       
   231 		0x044e
       
   232 		},
       
   233 		{
       
   234 		0x0430
       
   235 		},
       
   236 		{
       
   237 		0x0431
       
   238 		},
       
   239 		{
       
   240 		0x0446
       
   241 		},
       
   242 		{
       
   243 		0x0434
       
   244 		},
       
   245 		{
       
   246 		0x0435
       
   247 		},
       
   248 		{
       
   249 		0x0444
       
   250 		},
       
   251 		{
       
   252 		0x0433
       
   253 		},
       
   254 		{
       
   255 		0x0445
       
   256 		},
       
   257 		{
       
   258 		0x0438
       
   259 		},
       
   260 		{
       
   261 		0x0439
       
   262 		},
       
   263 		{
       
   264 		0x043a
       
   265 		},
       
   266 		{
       
   267 		0x043b
       
   268 		},
       
   269 		{
       
   270 		0x043c
       
   271 		},
       
   272 		{
       
   273 		0x043d
       
   274 		},
       
   275 		{
       
   276 		0x043e
       
   277 		},
       
   278 		{
       
   279 		0x043f
       
   280 		},
       
   281 		{
       
   282 		0x044f
       
   283 		},
       
   284 		{
       
   285 		0x0440
       
   286 		},
       
   287 		{
       
   288 		0x0441
       
   289 		},
       
   290 		{
       
   291 		0x0442
       
   292 		},
       
   293 		{
       
   294 		0x0443
       
   295 		},
       
   296 		{
       
   297 		0x0436
       
   298 		},
       
   299 		{
       
   300 		0x0432
       
   301 		},
       
   302 		{
       
   303 		0x044c
       
   304 		},
       
   305 		{
       
   306 		0x044b
       
   307 		},
       
   308 		{
       
   309 		0x0437
       
   310 		},
       
   311 		{
       
   312 		0x0448
       
   313 		},
       
   314 		{
       
   315 		0x044d
       
   316 		},
       
   317 		{
       
   318 		0x0449
       
   319 		},
       
   320 		{
       
   321 		0x0447
       
   322 		},
       
   323 		{
       
   324 		0x044a
       
   325 		},
       
   326 		{
       
   327 		0x042e
       
   328 		},
       
   329 		{
       
   330 		0x0410
       
   331 		},
       
   332 		{
       
   333 		0x0411
       
   334 		},
       
   335 		{
       
   336 		0x0426
       
   337 		},
       
   338 		{
       
   339 		0x0414
       
   340 		},
       
   341 		{
       
   342 		0x0415
       
   343 		},
       
   344 		{
       
   345 		0x0424
       
   346 		},
       
   347 		{
       
   348 		0x0413
       
   349 		},
       
   350 		{
       
   351 		0x0425
       
   352 		},
       
   353 		{
       
   354 		0x0418
       
   355 		},
       
   356 		{
       
   357 		0x0419
       
   358 		},
       
   359 		{
       
   360 		0x041a
       
   361 		},
       
   362 		{
       
   363 		0x041b
       
   364 		},
       
   365 		{
       
   366 		0x041c
       
   367 		},
       
   368 		{
       
   369 		0x041d
       
   370 		},
       
   371 		{
       
   372 		0x041e
       
   373 		},
       
   374 		{
       
   375 		0x041f
       
   376 		},
       
   377 		{
       
   378 		0x042f
       
   379 		},
       
   380 		{
       
   381 		0x0420
       
   382 		},
       
   383 		{
       
   384 		0x0421
       
   385 		},
       
   386 		{
       
   387 		0x0422
       
   388 		},
       
   389 		{
       
   390 		0x0423
       
   391 		},
       
   392 		{
       
   393 		0x0416
       
   394 		},
       
   395 		{
       
   396 		0x0412
       
   397 		},
       
   398 		{
       
   399 		0x042c
       
   400 		},
       
   401 		{
       
   402 		0x042b
       
   403 		},
       
   404 		{
       
   405 		0x0417
       
   406 		},
       
   407 		{
       
   408 		0x0428
       
   409 		},
       
   410 		{
       
   411 		0x042d
       
   412 		},
       
   413 		{
       
   414 		0x0429
       
   415 		},
       
   416 		{
       
   417 		0x0427
       
   418 		},
       
   419 		{
       
   420 		0x042a
       
   421 		}
       
   422 	};
       
   423 
       
   424 LOCAL_D const SCnvConversionData::SOneDirectionData::SRange::UData::SIndexedTable16::SEntry indexedTable16_unicodeToForeign_1[]=
       
   425 	{
       
   426 		{
       
   427 		0xe1
       
   428 		},
       
   429 		{
       
   430 		0xe2
       
   431 		},
       
   432 		{
       
   433 		0xf7
       
   434 		},
       
   435 		{
       
   436 		0xe7
       
   437 		},
       
   438 		{
       
   439 		0xe4
       
   440 		},
       
   441 		{
       
   442 		0xe5
       
   443 		},
       
   444 		{
       
   445 		0xf6
       
   446 		},
       
   447 		{
       
   448 		0xfa
       
   449 		},
       
   450 		{
       
   451 		0xe9
       
   452 		},
       
   453 		{
       
   454 		0xea
       
   455 		},
       
   456 		{
       
   457 		0xeb
       
   458 		},
       
   459 		{
       
   460 		0xec
       
   461 		},
       
   462 		{
       
   463 		0xed
       
   464 		},
       
   465 		{
       
   466 		0xee
       
   467 		},
       
   468 		{
       
   469 		0xef
       
   470 		},
       
   471 		{
       
   472 		0xf0
       
   473 		},
       
   474 		{
       
   475 		0xf2
       
   476 		},
       
   477 		{
       
   478 		0xf3
       
   479 		},
       
   480 		{
       
   481 		0xf4
       
   482 		},
       
   483 		{
       
   484 		0xf5
       
   485 		},
       
   486 		{
       
   487 		0xe6
       
   488 		},
       
   489 		{
       
   490 		0xe8
       
   491 		},
       
   492 		{
       
   493 		0xe3
       
   494 		},
       
   495 		{
       
   496 		0xfe
       
   497 		},
       
   498 		{
       
   499 		0xfb
       
   500 		},
       
   501 		{
       
   502 		0xfd
       
   503 		},
       
   504 		{
       
   505 		0xff
       
   506 		},
       
   507 		{
       
   508 		0xf9
       
   509 		},
       
   510 		{
       
   511 		0xf8
       
   512 		},
       
   513 		{
       
   514 		0xfc
       
   515 		},
       
   516 		{
       
   517 		0xe0
       
   518 		},
       
   519 		{
       
   520 		0xf1
       
   521 		},
       
   522 		{
       
   523 		0xc1
       
   524 		},
       
   525 		{
       
   526 		0xc2
       
   527 		},
       
   528 		{
       
   529 		0xd7
       
   530 		},
       
   531 		{
       
   532 		0xc7
       
   533 		},
       
   534 		{
       
   535 		0xc4
       
   536 		},
       
   537 		{
       
   538 		0xc5
       
   539 		},
       
   540 		{
       
   541 		0xd6
       
   542 		},
       
   543 		{
       
   544 		0xda
       
   545 		},
       
   546 		{
       
   547 		0xc9
       
   548 		},
       
   549 		{
       
   550 		0xca
       
   551 		},
       
   552 		{
       
   553 		0xcb
       
   554 		},
       
   555 		{
       
   556 		0xcc
       
   557 		},
       
   558 		{
       
   559 		0xcd
       
   560 		},
       
   561 		{
       
   562 		0xce
       
   563 		},
       
   564 		{
       
   565 		0xcf
       
   566 		},
       
   567 		{
       
   568 		0xd0
       
   569 		},
       
   570 		{
       
   571 		0xd2
       
   572 		},
       
   573 		{
       
   574 		0xd3
       
   575 		},
       
   576 		{
       
   577 		0xd4
       
   578 		},
       
   579 		{
       
   580 		0xd5
       
   581 		},
       
   582 		{
       
   583 		0xc6
       
   584 		},
       
   585 		{
       
   586 		0xc8
       
   587 		},
       
   588 		{
       
   589 		0xc3
       
   590 		},
       
   591 		{
       
   592 		0xde
       
   593 		},
       
   594 		{
       
   595 		0xdb
       
   596 		},
       
   597 		{
       
   598 		0xdd
       
   599 		},
       
   600 		{
       
   601 		0xdf
       
   602 		},
       
   603 		{
       
   604 		0xd9
       
   605 		},
       
   606 		{
       
   607 		0xd8
       
   608 		},
       
   609 		{
       
   610 		0xdc
       
   611 		},
       
   612 		{
       
   613 		0xc0
       
   614 		},
       
   615 		{
       
   616 		0xd1
       
   617 		}
       
   618 	};
       
   619 
       
   620 LOCAL_D const SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry keyedTable1616_unicodeToForeign_1[]=
       
   621 	{
       
   622 		{
       
   623 		0x00a0,
       
   624 		0x9a
       
   625 		},
       
   626 		{
       
   627 		0x00a9,
       
   628 		0xbf
       
   629 		},
       
   630 		{
       
   631 		0x00b0,
       
   632 		0x9c
       
   633 		},
       
   634 		{
       
   635 		0x00b2,
       
   636 		0x9d
       
   637 		},
       
   638 		{
       
   639 		0x00b7,
       
   640 		0x9e
       
   641 		},
       
   642 		{
       
   643 		0x00f7,
       
   644 		0x9f
       
   645 		},
       
   646 		{
       
   647 		0x0401,
       
   648 		0xb3
       
   649 		},
       
   650 		{
       
   651 		0x0404,
       
   652 		0xb4
       
   653 		},
       
   654 		{
       
   655 		0x0406,
       
   656 		0xb6
       
   657 		},
       
   658 		{
       
   659 		0x0407,
       
   660 		0xb7
       
   661 		}
       
   662 	};
       
   663 
       
   664 LOCAL_D const SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry keyedTable1616_unicodeToForeign_2[]=
       
   665 	{
       
   666 		{
       
   667 		0x0451,
       
   668 		0xa3
       
   669 		},
       
   670 		{
       
   671 		0x0454,
       
   672 		0xa4
       
   673 		},
       
   674 		{
       
   675 		0x0456,
       
   676 		0xa6
       
   677 		},
       
   678 		{
       
   679 		0x0457,
       
   680 		0xa7
       
   681 		},
       
   682 		{
       
   683 		0x0490,
       
   684 		0xbd
       
   685 		},
       
   686 		{
       
   687 		0x0491,
       
   688 		0xad
       
   689 		},
       
   690 		{
       
   691 		0x2219,
       
   692 		0x95
       
   693 		},
       
   694 		{
       
   695 		0x221a,
       
   696 		0x96
       
   697 		},
       
   698 		{
       
   699 		0x2248,
       
   700 		0x97
       
   701 		},
       
   702 		{
       
   703 		0x2264,
       
   704 		0x98
       
   705 		},
       
   706 		{
       
   707 		0x2265,
       
   708 		0x99
       
   709 		},
       
   710 		{
       
   711 		0x2320,
       
   712 		0x93
       
   713 		},
       
   714 		{
       
   715 		0x2321,
       
   716 		0x9b
       
   717 		},
       
   718 		{
       
   719 		0x2500,
       
   720 		0x80
       
   721 		},
       
   722 		{
       
   723 		0x2502,
       
   724 		0x81
       
   725 		},
       
   726 		{
       
   727 		0x250c,
       
   728 		0x82
       
   729 		},
       
   730 		{
       
   731 		0x2510,
       
   732 		0x83
       
   733 		},
       
   734 		{
       
   735 		0x2514,
       
   736 		0x84
       
   737 		},
       
   738 		{
       
   739 		0x2518,
       
   740 		0x85
       
   741 		},
       
   742 		{
       
   743 		0x251c,
       
   744 		0x86
       
   745 		},
       
   746 		{
       
   747 		0x2524,
       
   748 		0x87
       
   749 		},
       
   750 		{
       
   751 		0x252c,
       
   752 		0x88
       
   753 		},
       
   754 		{
       
   755 		0x2534,
       
   756 		0x89
       
   757 		},
       
   758 		{
       
   759 		0x253c,
       
   760 		0x8a
       
   761 		},
       
   762 		{
       
   763 		0x2550,
       
   764 		0xa0
       
   765 		},
       
   766 		{
       
   767 		0x2551,
       
   768 		0xa1
       
   769 		},
       
   770 		{
       
   771 		0x2552,
       
   772 		0xa2
       
   773 		},
       
   774 		{
       
   775 		0x2554,
       
   776 		0xa5
       
   777 		},
       
   778 		{
       
   779 		0x2557,
       
   780 		0xa8
       
   781 		},
       
   782 		{
       
   783 		0x2558,
       
   784 		0xa9
       
   785 		},
       
   786 		{
       
   787 		0x2559,
       
   788 		0xaa
       
   789 		},
       
   790 		{
       
   791 		0x255a,
       
   792 		0xab
       
   793 		},
       
   794 		{
       
   795 		0x255b,
       
   796 		0xac
       
   797 		},
       
   798 		{
       
   799 		0x255d,
       
   800 		0xae
       
   801 		},
       
   802 		{
       
   803 		0x255e,
       
   804 		0xaf
       
   805 		},
       
   806 		{
       
   807 		0x255f,
       
   808 		0xb0
       
   809 		},
       
   810 		{
       
   811 		0x2560,
       
   812 		0xb1
       
   813 		},
       
   814 		{
       
   815 		0x2561,
       
   816 		0xb2
       
   817 		},
       
   818 		{
       
   819 		0x2563,
       
   820 		0xb5
       
   821 		},
       
   822 		{
       
   823 		0x2566,
       
   824 		0xb8
       
   825 		},
       
   826 		{
       
   827 		0x2567,
       
   828 		0xb9
       
   829 		},
       
   830 		{
       
   831 		0x2568,
       
   832 		0xba
       
   833 		},
       
   834 		{
       
   835 		0x2569,
       
   836 		0xbb
       
   837 		},
       
   838 		{
       
   839 		0x256a,
       
   840 		0xbc
       
   841 		},
       
   842 		{
       
   843 		0x256c,
       
   844 		0xbe
       
   845 		},
       
   846 		{
       
   847 		0x2580,
       
   848 		0x8b
       
   849 		},
       
   850 		{
       
   851 		0x2584,
       
   852 		0x8c
       
   853 		},
       
   854 		{
       
   855 		0x2588,
       
   856 		0x8d
       
   857 		},
       
   858 		{
       
   859 		0x258c,
       
   860 		0x8e
       
   861 		},
       
   862 		{
       
   863 		0x2590,
       
   864 		0x8f
       
   865 		},
       
   866 		{
       
   867 		0x2591,
       
   868 		0x90
       
   869 		},
       
   870 		{
       
   871 		0x2592,
       
   872 		0x91
       
   873 		},
       
   874 		{
       
   875 		0x2593,
       
   876 		0x92
       
   877 		},
       
   878 		{
       
   879 		0x25a0,
       
   880 		0x94
       
   881 		}
       
   882 	};
       
   883 
       
   884 LOCAL_D const SCnvConversionData::SVariableByteData::SRange foreignVariableByteDataRanges[]=
       
   885 	{
       
   886 		{
       
   887 		0x00,
       
   888 		0xff,
       
   889 		0,
       
   890 		0
       
   891 		}
       
   892 	};
       
   893 
       
   894 LOCAL_D const SCnvConversionData::SOneDirectionData::SRange foreignToUnicodeDataRanges[]=
       
   895 	{
       
   896 		{
       
   897 		0x00,
       
   898 		0x7f,
       
   899 		SCnvConversionData::SOneDirectionData::SRange::EDirect,
       
   900 		0,
       
   901 		0,
       
   902 			{
       
   903 			0
       
   904 			}
       
   905 		},
       
   906 		{
       
   907 		0x80,
       
   908 		0xff,
       
   909 		SCnvConversionData::SOneDirectionData::SRange::EIndexedTable16,
       
   910 		0,
       
   911 		0,
       
   912 			{
       
   913 			UData_SIndexedTable16(indexedTable16_foreignToUnicode_1)
       
   914 			}
       
   915 		}
       
   916 	};
       
   917 
       
   918 LOCAL_D const SCnvConversionData::SOneDirectionData::SRange unicodeToForeignDataRanges[]=
       
   919 	{
       
   920 		{
       
   921 		0x0000,
       
   922 		0x007f,
       
   923 		SCnvConversionData::SOneDirectionData::SRange::EDirect,
       
   924 		1,
       
   925 		0,
       
   926 			{
       
   927 			0
       
   928 			}
       
   929 		},
       
   930 		{
       
   931 		0x00a0,
       
   932 		0x0407,
       
   933 		SCnvConversionData::SOneDirectionData::SRange::EKeyedTable1616,
       
   934 		1,
       
   935 		0,
       
   936 			{
       
   937 			UData_SKeyedTable1616(keyedTable1616_unicodeToForeign_1)
       
   938 			}
       
   939 		},
       
   940 		{
       
   941 		0x0410,
       
   942 		0x044f,
       
   943 		SCnvConversionData::SOneDirectionData::SRange::EIndexedTable16,
       
   944 		1,
       
   945 		0,
       
   946 			{
       
   947 			UData_SIndexedTable16(indexedTable16_unicodeToForeign_1)
       
   948 			}
       
   949 		},
       
   950 		{
       
   951 		0x0451,
       
   952 		0x25a0,
       
   953 		SCnvConversionData::SOneDirectionData::SRange::EKeyedTable1616,
       
   954 		1,
       
   955 		0,
       
   956 			{
       
   957 			UData_SKeyedTable1616(keyedTable1616_unicodeToForeign_2)
       
   958 			}
       
   959 		}
       
   960 	};
       
   961 
       
   962 GLDEF_D const SCnvConversionData conversionData=
       
   963 	{
       
   964 	SCnvConversionData::EFixedBigEndian,
       
   965 		{
       
   966 		ARRAY_LENGTH(foreignVariableByteDataRanges),
       
   967 		foreignVariableByteDataRanges
       
   968 		},
       
   969 		{
       
   970 		ARRAY_LENGTH(foreignToUnicodeDataRanges),
       
   971 		foreignToUnicodeDataRanges
       
   972 		},
       
   973 		{
       
   974 		ARRAY_LENGTH(unicodeToForeignDataRanges),
       
   975 		unicodeToForeignDataRanges
       
   976 		},
       
   977 	NULL,
       
   978 	NULL
       
   979 	};
       
   980