Home | History | Annotate | Download | only in common

Lines Matching refs:cnv

119  * - Added an optional extension table structure at the end of the .cnv file.
933 ucnv_MBCSGetUnicodeSet(const UConverter *cnv,
937 if(cnv->options&_MBCS_OPTION_GB18030) {
941 ucnv_MBCSGetUnicodeSetForUnicode(cnv->sharedData, sa, which, pErrorCode);
959 * @return if(U_FAILURE) return the code point for cnv->fromUChar32
963 _extFromU(UConverter *cnv, const UConverterSharedData *sharedData,
972 cnv->useSubChar1=FALSE;
976 cnv, cx,
987 if((cnv->options&_MBCS_OPTION_GB18030)!=0) {
1011 ucnv_fromUWriteBytes(cnv,
1025 * Input sequence: cnv->toUBytes[0..length[
1030 _extToU(UConverter *cnv, const UConverterSharedData *sharedData,
1041 cnv, cx,
1052 if(length==4 && (cnv->options&_MBCS_OPTION_GB18030)!=0) {
1057 linear=LINEAR_18030(cnv->toUBytes[0], cnv->toUBytes[1], cnv->toUBytes[2], cnv->toUBytes[3]);
1068 ucnv_toUWriteCodePoint(cnv, linear, target, targetLimit, offsets, sourceIndex, pErrorCode);
1188 * This affects only some .cnv file formats with a header.version
1475 /* TODO parse package name out of the prefix of the base name in the extension .cnv file? */
1684 * The .cnv file is prebuilt with an additional stage table with indexes
1757 ucnv_MBCSOpen(UConverter *cnv,
1769 mbcsTable=&cnv->sharedData->mbcs;
1774 cnv->options=pArgs->options&=~UCNV_OPTION_SWAP_LFNL;
1786 if(!_EBCDICSwapLFNL(cnv->sharedData, pErrorCode)) {
1792 cnv->options=pArgs->options&=~UCNV_OPTION_SWAP_LFNL;
1800 cnv->options|=_MBCS_OPTION_GB18030;
1804 cnv->options|=_MBCS_OPTION_KEIS;
1807 cnv->options|=_MBCS_OPTION_JEF;
1810 cnv->options|=_MBCS_OPTION_JIPS;
1815 cnv->maxBytesPerUChar=3; /* SO+DBCS */
1825 if(maxBytesPerUChar>cnv->maxBytesPerUChar) {
1826 cnv->maxBytesPerUChar=maxBytesPerUChar;
1837 cnv->toUnicodeStatus=0; /* offset */
1838 cnv->mode=0; /* state */
1839 cnv->toULength=0; /* byteIndex */
1842 cnv->fromUChar32=0;
1843 cnv->fromUnicodeStatus=1; /* prevLength */
1848 ucnv_MBCSGetName(const UConverter *cnv) {
1849 if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0 && cnv->sharedData->mbcs.swapLFNLName!=NULL) {
1850 return cnv->sharedData->mbcs.swapLFNLName;
1852 return cnv->sharedData->staticData->name;
1890 UConverter *cnv;
1905 cnv=pArgs->converter;
1912 if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0) {
1913 stateTable=(const int32_t (*)[256])cnv->sharedData->mbcs.swapLFNLStateTable;
1915 stateTable=cnv->sharedData->mbcs.stateTable;
1959 (action==MBCS_STATE_FALLBACK_DIRECT_20 && UCNV_TO_U_USE_FALLBACK(cnv))
1975 cnv->UCharErrorBuffer[0]=c;
1976 cnv->UCharErrorBufferLength=1;
1984 if(UCNV_TO_U_USE_FALLBACK(cnv)) {
2011 cnv->toUBytes[0]=*(source-1);
2012 cnv->toULength=_extToU(cnv, cnv->sharedData,
2042 UConverter *cnv;
2056 cnv=pArgs->converter;
2063 if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0) {
2064 stateTable=(const int32_t (*)[256])cnv->sharedData->mbcs.swapLFNLStateTable;
2066 stateTable=cnv->sharedData->mbcs.stateTable;
2179 if(UCNV_TO_U_USE_FALLBACK(cnv)) {
2212 cnv->toUBytes[0]=*(source-1);
2213 cnv->toULength=_extToU(cnv, cnv->sharedData,
2322 UConverter *cnv;
2343 cnv=pArgs->converter;
2345 if(cnv->preToULength>0) {
2350 ucnv_extContinueMatchToU(cnv, pArgs, -1, pErrorCode);
2352 if(U_FAILURE(*pErrorCode) || cnv->preToULength<0) {
2357 if(cnv->sharedData->mbcs.countStates==1) {
2358 if(!(cnv->sharedData->mbcs.unicodeMask&UCNV_HAS_SUPPLEMENTARY)) {
2373 if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0) {
2374 stateTable=(const int32_t (*)[256])cnv->sharedData->mbcs.swapLFNLStateTable;
2376 stateTable=cnv->sharedData->mbcs.stateTable;
2378 unicodeCodeUnits=cnv->sharedData->mbcs.unicodeCodeUnits;
2381 offset=cnv->toUnicodeStatus;
2382 byteIndex=cnv->toULength;
2383 bytes=cnv->toUBytes;
2390 if((state=(uint8_t)(cnv->mode))==0) {
2391 state=cnv->sharedData->mbcs.dbcsOnlyState;
2524 cnv->mode=state;
2545 if(UCNV_TO_U_USE_FALLBACK(cnv) && (entry=(int32_t)ucnv_MBCSGetFallback(&cnv->sharedData->mbcs, offset))!=0xfffe) {
2574 } else if(UCNV_TO_U_USE_FALLBACK(cnv) ? c<=0xdfff : c<=0xdbff) {
2588 cnv->UCharErrorBuffer[0]=unicodeCodeUnits[offset];
2589 cnv->UCharErrorBufferLength=1;
2595 } else if(UCNV_TO_U_USE_FALLBACK(cnv) ? (c&0xfffe)==0xe000 : c==0xe000) {
2607 (action==MBCS_STATE_FALLBACK_DIRECT_20 && UCNV_TO_U_USE_FALLBACK(cnv))
2624 cnv->UCharErrorBuffer[0]=c;
2625 cnv->UCharErrorBufferLength=1;
2639 if(cnv->sharedData->mbcs.dbcsOnlyState==0) {
2643 state=(uint8_t)(cnv->mode); /* restore the previous state */
2649 if(UCNV_TO_U_USE_FALLBACK(cnv)) {
2681 UBool isDBCSOnly=(UBool)(cnv->sharedData->mbcs.dbcsOnlyState!=0);
2695 cnv->preToULength=(int8_t)(bytesFromThisBuffer-backOutDistance);
2697 uprv_memcpy(cnv->preToU, bytes+i, -cnv->preToULength);
2706 byteIndex=_extToU(cnv, cnv->sharedData,
2722 cnv->toUnicodeStatus=offset;
2723 cnv->mode=state;
2724 cnv->toULength=byteIndex;
2739 UConverter *cnv;
2747 cnv=pArgs->converter;
2750 if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0) {
2751 stateTable=(const int32_t (*)[256])cnv->sharedData->mbcs.swapLFNLStateTable;
2753 stateTable=cnv->sharedData->mbcs.stateTable;
2775 (action==MBCS_STATE_FALLBACK_DIRECT_20 && UCNV_TO_U_USE_FALLBACK(cnv))
2780 if(UCNV_TO_U_USE_FALLBACK(cnv)) {
2824 UConverter *cnv;
2838 cnv=pArgs->converter;
2840 if(cnv->preToULength>0) {
2845 if(cnv->sharedData->mbcs.unicodeMask&UCNV_HAS_SURROGATES) {
2852 } else if(cnv->sharedData->mbcs.countStates==1) {
2860 if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0) {
2861 stateTable=(const int32_t (*)[256])cnv->sharedData->mbcs.swapLFNLStateTable;
2863 stateTable=cnv->sharedData->mbcs.stateTable;
2865 unicodeCodeUnits=cnv->sharedData->mbcs.unicodeCodeUnits;
2868 offset=cnv->toUnicodeStatus;
2875 if((state=(uint8_t)(cnv->mode))==0) {
2876 state=cnv->sharedData->mbcs.dbcsOnlyState;
2900 cnv->mode=state;
2921 if(UCNV_TO_U_USE_FALLBACK(cnv) && (c=ucnv_MBCSGetFallback(&cnv->sharedData->mbcs, offset))!=0xfffe) {
2934 } else if(UCNV_TO_U_USE_FALLBACK(cnv) ? c<=0xdfff : c<=0xdbff) {
2938 } else if(UCNV_TO_U_USE_FALLBACK(cnv) ? (c&0xfffe)==0xe000 : c==0xe000) {
2947 (action==MBCS_STATE_FALLBACK_DIRECT_20 && UCNV_TO_U_USE_FALLBACK(cnv))
2960 if(cnv->sharedData->mbcs.dbcsOnlyState!=0) {
2962 state=(uint8_t)(cnv->mode); /* restore the previous state */
2968 if(UCNV_TO_U_USE_FALLBACK(cnv)) {
2993 cnv->toUnicodeStatus=0;
2994 cnv->mode=state;
3004 uint8_t *bytes=cnv->toUBytes;
3005 cnv->toULength=(int8_t)(source-lastSource);
3018 UBool isDBCSOnly=(UBool)(cnv->sharedData->mbcs.dbcsOnlyState!=0);
3019 uint8_t *bytes=cnv->toUBytes;
3022 cnv->toULength=1;
3031 cnv->toULength=i;
3042 cnv->toUnicodeStatus=0;
3043 cnv->mode=state;
3182 } else if(UCNV_TO_U_USE_FALLBACK(cnv)) {
3196 } else if(UCNV_TO_U_USE_FALLBACK(cnv) ? c<=0xdfff : c<=0xdbff) {
3199 } else if(UCNV_TO_U_USE_FALLBACK(cnv) ? (c&0xfffe)==0xe000 : c==0xe000) {
3263 UConverter *cnv;
3283 cnv=pArgs->converter;
3284 unicodeMask=cnv->sharedData->mbcs.unicodeMask;
3293 table=cnv->sharedData->mbcs.fromUnicodeTable;
3294 mbcsIndex=cnv->sharedData->mbcs.mbcsIndex;
3295 if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0) {
3296 bytes=cnv->sharedData->mbcs.swapLFNLFromUnicodeBytes;
3298 bytes=cnv->sharedData->mbcs.fromUnicodeBytes;
3300 asciiRoundtrips=cnv->sharedData->mbcs.asciiRoundtrips;
3303 c=cnv->fromUChar32;
3403 (UCNV_FROM_U_USE_FALLBACK(cnv, c) && value!=0))
3414 c=_extFromU(cnv, cnv->sharedData,
3460 cnv->charErrorBuffer[0]=(char)value;
3461 cnv->charErrorBufferLength=1;
3483 cnv->fromUChar32=c;
3495 UConverter *cnv;
3512 cnv=pArgs->converter;
3519 table=cnv->sharedData->mbcs.fromUnicodeTable;
3520 if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0) {
3521 results=(uint16_t *)cnv->sharedData->mbcs.swapLFNLFromUnicodeBytes;
3523 results=(uint16_t *)cnv->sharedData->mbcs.fromUnicodeBytes;
3526 if(cnv->useFallback) {
3533 hasSupplementary=(UBool)(cnv->sharedData->mbcs.unicodeMask&UCNV_HAS_SUPPLEMENTARY);
3536 c=cnv->fromUChar32;
3620 c=_extFromU(cnv, cnv->sharedData,
3649 cnv->fromUChar32=c;
3671 UConverter *cnv;
3688 cnv=pArgs->converter;
3695 table=cnv->sharedData->mbcs.fromUnicodeTable;
3696 if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0) {
3697 results=(uint16_t *)cnv->sharedData->mbcs.swapLFNLFromUnicodeBytes;
3699 results=(uint16_t *)cnv->sharedData->mbcs.fromUnicodeBytes;
3701 asciiRoundtrips=cnv->sharedData->mbcs.asciiRoundtrips;
3703 if(cnv->useFallback) {
3712 c=cnv->fromUChar32;
3865 c=_extFromU(cnv, cnv->sharedData,
3917 cnv->fromUChar32=c;
3928 UConverter *cnv;
3952 cnv=pArgs->converter;
3954 if(cnv->preFromUFirstCP>=0) {
3959 ucnv_extContinueMatchFromU(cnv, pArgs, -1, pErrorCode);
3961 if(U_FAILURE(*pErrorCode) || cnv->preFromULength<0) {
3967 outputType=cnv->sharedData->mbcs.outputType;
3968 unicodeMask=cnv->sharedData->mbcs.unicodeMask;
3976 } else if(outputType==MBCS_OUTPUT_2 && cnv->sharedData->mbcs.utf8Friendly) {
3988 table=cnv->sharedData->mbcs.fromUnicodeTable;
3989 if(cnv->sharedData->mbcs.utf8Friendly) {
3990 mbcsIndex=cnv->sharedData->mbcs.mbcsIndex;
3994 if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0) {
3995 bytes=cnv->sharedData->mbcs.swapLFNLFromUnicodeBytes;
3997 bytes=cnv->sharedData->mbcs.fromUnicodeBytes;
3999 asciiRoundtrips=cnv->sharedData->mbcs.asciiRoundtrips;
4002 c=cnv->fromUChar32;
4005 prevLength=cnv->fromUnicodeStatus;
4021 si_value_length = getSISOBytes(SI, cnv->options, si_value);
4022 so_value_length = getSISOBytes(SO, cnv->options, so_value);
4104 cnv->fromUnicodeStatus=prevLength; /* save the old state */
4254 cnv->fromUnicodeStatus=prevLength; /* save the old state */
4335 cnv->fromUnicodeStatus=prevLength; /* save the old state */
4455 (UCNV_FROM_U_USE_FALLBACK(cnv, c) && value!=0))
4466 c=_extFromU(cnv, cnv->sharedData,
4473 prevLength=cnv->fromUnicodeStatus; /* restore SISO state */
4544 charErrorBuffer=(uint8_t *)cnv->charErrorBuffer;
4557 cnv->charErrorBufferLength=(int8_t)length;
4623 cnv->charErrorBuffer[0]=(uint8_t)si_value[1];
4624 cnv->charErrorBufferLength=1;
4636 cnv->charErrorBuffer[0]=(uint8_t)si_value[0];
4638 cnv->charErrorBuffer[1]=(uint8_t)si_value[1];
4640 cnv->charErrorBufferLength=si_value_length;
4647 cnv->fromUChar32=c;
4648 cnv->fromUnicodeStatus=prevLength;
4867 UConverter *utf8, *cnv;
4886 cnv=pFromUArgs->converter;
4892 table=cnv->sharedData->mbcs.fromUnicodeTable;
4893 sbcsIndex=cnv->sharedData->mbcs.sbcsIndex;
4894 if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0) {
4895 results=(uint16_t *)cnv->sharedData->mbcs.swapLFNLFromUnicodeBytes;
4897 results=(uint16_t *)cnv->sharedData->mbcs.fromUnicodeBytes;
4899 asciiRoundtrips=cnv->sharedData->mbcs.asciiRoundtrips;
4901 if(cnv->useFallback) {
4908 hasSupplementary=(UBool)(cnv->sharedData->mbcs.unicodeMask&UCNV_HAS_SUPPLEMENTARY);
4957 * (utf8, source, target, limits but not cnv, table, minValue, etc.).
5110 cnv, cnv->sharedData,
5119 cnv->fromUChar32=c;
5121 } else if(cnv->preFromUFirstCP>=0) {
5170 UConverter *utf8, *cnv;
5190 cnv=pFromUArgs->converter;
5196 table=cnv->sharedData->mbcs.fromUnicodeTable;
5197 mbcsIndex=cnv->sharedData->mbcs.mbcsIndex;
5198 if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0) {
5199 results=(uint16_t *)cnv->sharedData->mbcs.swapLFNLFromUnicodeBytes;
5201 results=(uint16_t *)cnv->sharedData->mbcs.fromUnicodeBytes;
5203 asciiRoundtrips=cnv->sharedData->mbcs.asciiRoundtrips;
5205 if(cnv->useFallback) {
5212 hasSupplementary=(UBool)(cnv->sharedData->mbcs.unicodeMask&UCNV_HAS_SUPPLEMENTARY);
5384 (UCNV_FROM_U_USE_FALLBACK(cnv, c) && value!=0))
5403 cnv->charErrorBuffer[0]=(char)value;
5404 cnv->charErrorBufferLength=1;
5423 c=_extFromU(cnv, cnv->sharedData,
5432 cnv->fromUChar32=c;
5434 } else if(cnv->preFromUFirstCP>=0) {
5483 ucnv_MBCSGetStarters(const UConverter* cnv,
5489 state0=cnv->sharedData->mbcs.stateTable[cnv->sharedData->mbcs.dbcsOnlyState];
5509 UConverter *cnv=pArgs->converter;
5515 if( cnv->subChar1!=0 &&
5516 (cnv->sharedData->mbcs.extIndexes!=NULL ?
5517 cnv->useSubChar1 :
5518 (cnv->invalidUCharBuffer[0]<=0xff))
5521 subchar=(char *)&cnv->subChar1;
5525 subchar=(char *)cnv->subChars;
5526 length=cnv->subCharLen;
5530 cnv->useSubChar1=FALSE;
5532 if (cnv->sharedData->mbcs.outputType == MBCS_OUTPUT_2_SISO) {
5538 if(cnv->fromUnicodeStatus==2) {
5540 cnv->fromUnicodeStatus=1;
5546 if(cnv->fromUnicodeStatus<=1) {
5548 cnv->fromUnicodeStatus=2;