| OLD | NEW |
| 1 /* | 1 /* |
| 2 ********************************************************************** | 2 ********************************************************************** |
| 3 * Copyright (C) 2000-2006, International Business Machines | 3 * Copyright (C) 2000-2007, International Business Machines |
| 4 * Corporation and others. All Rights Reserved. | 4 * Corporation and others. All Rights Reserved. |
| 5 ********************************************************************** | 5 ********************************************************************** |
| 6 * file name: ucnv_lmb.cpp | 6 * file name: ucnv_lmb.cpp |
| 7 * encoding: US-ASCII | 7 * encoding: US-ASCII |
| 8 * tab size: 4 (not used) | 8 * tab size: 4 (not used) |
| 9 * indentation:4 | 9 * indentation:4 |
| 10 * | 10 * |
| 11 * created on: 2000feb09 | 11 * created on: 2000feb09 |
| 12 * created by: Brendan Murray | 12 * created by: Brendan Murray |
| 13 * extensively hacked up by: Jim Snyder-Grant | 13 * extensively hacked up by: Jim Snyder-Grant |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 NULL,\ | 529 NULL,\ |
| 530 _LMBCSToUnicodeWithOffsets,\ | 530 _LMBCSToUnicodeWithOffsets,\ |
| 531 _LMBCSToUnicodeWithOffsets,\ | 531 _LMBCSToUnicodeWithOffsets,\ |
| 532 _LMBCSFromUnicode,\ | 532 _LMBCSFromUnicode,\ |
| 533 _LMBCSFromUnicode,\ | 533 _LMBCSFromUnicode,\ |
| 534 NULL,\ | 534 NULL,\ |
| 535 NULL,\ | 535 NULL,\ |
| 536 NULL,\ | 536 NULL,\ |
| 537 NULL,\ | 537 NULL,\ |
| 538 _LMBCSSafeClone,\ | 538 _LMBCSSafeClone,\ |
| 539 _LMBCSGetUnicodeSet\ | 539 ucnv_getCompleteUnicodeSet\ |
| 540 };\ | 540 };\ |
| 541 static const UConverterStaticData _LMBCSStaticData##n={\ | 541 static const UConverterStaticData _LMBCSStaticData##n={\ |
| 542 sizeof(UConverterStaticData),\ | 542 sizeof(UConverterStaticData),\ |
| 543 "LMBCS-" #n,\ | 543 "LMBCS-" #n,\ |
| 544 0, UCNV_IBM, UCNV_LMBCS_##n, 1, 3,\ | 544 0, UCNV_IBM, UCNV_LMBCS_##n, 1, 3,\ |
| 545 { 0x3f, 0, 0, 0 },1,FALSE,FALSE,0,0,{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
\ | 545 { 0x3f, 0, 0, 0 },1,FALSE,FALSE,0,0,{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
\ |
| 546 };\ | 546 };\ |
| 547 const UConverterSharedData _LMBCSData##n={\ | 547 const UConverterSharedData _LMBCSData##n={\ |
| 548 sizeof(UConverterSharedData), ~((uint32_t) 0),\ | 548 sizeof(UConverterSharedData), ~((uint32_t) 0),\ |
| 549 NULL, NULL, &_LMBCSStaticData##n, FALSE, &_LMBCSImpl##n, \ | 549 NULL, NULL, &_LMBCSStaticData##n, FALSE, &_LMBCSImpl##n, \ |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 if(extraInfo->OptGrpConverter[i] != NULL) { | 655 if(extraInfo->OptGrpConverter[i] != NULL) { |
| 656 ucnv_incrementRefCount(extraInfo->OptGrpConverter[i]); | 656 ucnv_incrementRefCount(extraInfo->OptGrpConverter[i]); |
| 657 } | 657 } |
| 658 } | 658 } |
| 659 | 659 |
| 660 newLMBCS->cnv.extraInfo = &newLMBCS->lmbcs; | 660 newLMBCS->cnv.extraInfo = &newLMBCS->lmbcs; |
| 661 newLMBCS->cnv.isExtraLocal = TRUE; | 661 newLMBCS->cnv.isExtraLocal = TRUE; |
| 662 return &newLMBCS->cnv; | 662 return &newLMBCS->cnv; |
| 663 } | 663 } |
| 664 | 664 |
| 665 static void | 665 /* |
| 666 _LMBCSGetUnicodeSet(const UConverter *cnv, | 666 * There used to be a _LMBCSGetUnicodeSet() function here (up to svn revision 20
117) |
| 667 const USetAdder *sa, | 667 * which added all code points except for U+F6xx |
| 668 UConverterUnicodeSet which, | 668 * because those cannot be represented in the Unicode group. |
| 669 UErrorCode *pErrorCode) { | 669 * However, it turns out that windows-950 has roundtrips for all of U+F6xx |
| 670 /* all but U+F6xx, see LMBCS explanation above (search for F6xx) */ | 670 * which means that LMBCS can convert all Unicode code points after all. |
| 671 sa->addRange(sa->set, 0, 0xf5ff); | 671 * We now simply use ucnv_getCompleteUnicodeSet(). |
| 672 sa->addRange(sa->set, 0xf700, 0x10ffff); | 672 */ |
| 673 } | |
| 674 | 673 |
| 675 /* | 674 /* |
| 676 Here's the basic helper function that we use when converting from | 675 Here's the basic helper function that we use when converting from |
| 677 Unicode to LMBCS, and we suspect that a Unicode character will fit into | 676 Unicode to LMBCS, and we suspect that a Unicode character will fit into |
| 678 one of the 12 groups. The return value is the number of bytes written | 677 one of the 12 groups. The return value is the number of bytes written |
| 679 starting at pStartLMBCS (if any). | 678 starting at pStartLMBCS (if any). |
| 680 */ | 679 */ |
| 681 | 680 |
| 682 static size_t | 681 static size_t |
| 683 LMBCSConversionWorker ( | 682 LMBCSConversionWorker ( |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1272 DECLARE_LMBCS_DATA(5) | 1271 DECLARE_LMBCS_DATA(5) |
| 1273 DECLARE_LMBCS_DATA(6) | 1272 DECLARE_LMBCS_DATA(6) |
| 1274 DECLARE_LMBCS_DATA(8) | 1273 DECLARE_LMBCS_DATA(8) |
| 1275 DECLARE_LMBCS_DATA(11) | 1274 DECLARE_LMBCS_DATA(11) |
| 1276 DECLARE_LMBCS_DATA(16) | 1275 DECLARE_LMBCS_DATA(16) |
| 1277 DECLARE_LMBCS_DATA(17) | 1276 DECLARE_LMBCS_DATA(17) |
| 1278 DECLARE_LMBCS_DATA(18) | 1277 DECLARE_LMBCS_DATA(18) |
| 1279 DECLARE_LMBCS_DATA(19) | 1278 DECLARE_LMBCS_DATA(19) |
| 1280 | 1279 |
| 1281 #endif /* #if !UCONFIG_NO_LEGACY_CONVERSION */ | 1280 #endif /* #if !UCONFIG_NO_LEGACY_CONVERSION */ |
| OLD | NEW |