Lines Matching refs:cnv
50 UConverter *cnv;
66 cnv=pArgs->converter;
69 if(cnv->fromUnicodeStatus==UCNV_NEED_TO_WRITE_BOM) {
71 ucnv_fromUWriteBytes(cnv,
76 cnv->fromUnicodeStatus=0;
91 if((c=(UChar)cnv->fromUChar32)!=0 && U16_IS_TRAIL(trail=*source) && targetCapacity>=4) {
108 cnv->fromUChar32=c=0;
228 cnv->fromUChar32=c;
233 ucnv_fromUWriteBytes(cnv,
254 UConverter *cnv;
267 cnv=pArgs->converter;
270 if(length<=0 && cnv->toUnicodeStatus==0) {
287 if(cnv->toUnicodeStatus!=0) {
294 cnv->toUBytes[0]=(uint8_t)cnv->toUnicodeStatus;
295 cnv->toULength=1;
296 cnv->toUnicodeStatus=0;
298 if((count=cnv->toULength)!=0) {
299 uint8_t *p=cnv->toUBytes;
338 cnv->UCharErrorBuffer[0]=trail;
339 cnv->UCharErrorBufferLength=1;
358 cnv->toUnicodeStatus=0x100|p[2];
361 cnv->toULength=2;
371 cnv->toULength=(int8_t)count;
440 cnv->toUBytes[0]=(uint8_t)(c>>8);
441 cnv->toUBytes[1]=(uint8_t)c;
442 cnv->toULength=2;
454 cnv->UCharErrorBuffer[0]=trail;
455 cnv->UCharErrorBufferLength=1;
456 cnv->toULength=0;
478 cnv->toUBytes[cnv->toULength++]=*source++;
569 _UTF16BEReset(UConverter *cnv, UConverterResetChoice choice) {
572 if(UCNV_GET_VERSION(cnv)==0) {
573 cnv->mode=8; /* no BOM handling */
575 cnv->mode=0; /* Java-specific "UnicodeBig" requires BE BOM or no BOM */
578 if(choice!=UCNV_RESET_TO_UNICODE && UCNV_GET_VERSION(cnv)==1) {
580 cnv->fromUnicodeStatus=UCNV_NEED_TO_WRITE_BOM;
585 _UTF16BEOpen(UConverter *cnv,
588 if(UCNV_GET_VERSION(cnv)<=1) {
589 _UTF16BEReset(cnv, UCNV_RESET_BOTH);
596 _UTF16BEGetName(const UConverter *cnv) {
597 if(UCNV_GET_VERSION(cnv)==0) {
649 UConverter *cnv;
665 cnv=pArgs->converter;
668 if(cnv->fromUnicodeStatus==UCNV_NEED_TO_WRITE_BOM) {
670 ucnv_fromUWriteBytes(cnv,
675 cnv->fromUnicodeStatus=0;
690 if((c=(UChar)cnv->fromUChar32)!=0 && U16_IS_TRAIL(trail=*source) && targetCapacity>=4) {
707 cnv->fromUChar32=c=0;
827 cnv->fromUChar32=c;
832 ucnv_fromUWriteBytes(cnv,
853 UConverter *cnv;
866 cnv=pArgs->converter;
869 if(length<=0 && cnv->toUnicodeStatus==0) {
886 if(cnv->toUnicodeStatus!=0) {
893 cnv->toUBytes[0]=(uint8_t)cnv->toUnicodeStatus;
894 cnv->toULength=1;
895 cnv->toUnicodeStatus=0;
897 if((count=cnv->toULength)!=0) {
898 uint8_t *p=cnv->toUBytes;
937 cnv->UCharErrorBuffer[0]=trail;
938 cnv->UCharErrorBufferLength=1;
957 cnv->toUnicodeStatus=0x100|p[2];
960 cnv->toULength=2;
970 cnv->toULength=(int8_t)count;
1039 cnv->toUBytes[0]=(uint8_t)c;
1040 cnv->toUBytes[1]=(uint8_t)(c>>8);
1041 cnv->toULength=2;
1053 cnv->UCharErrorBuffer[0]=trail;
1054 cnv->UCharErrorBufferLength=1;
1055 cnv->toULength=0;
1077 cnv->toUBytes[cnv->toULength++]=*source++;
1168 _UTF16LEReset(UConverter *cnv, UConverterResetChoice choice) {
1171 if(UCNV_GET_VERSION(cnv)==0) {
1172 cnv->mode=8; /* no BOM handling */
1174 cnv->mode=0; /* Java-specific "UnicodeLittle" requires LE BOM or no BOM */
1177 if(choice!=UCNV_RESET_TO_UNICODE && UCNV_GET_VERSION(cnv)==1) {
1179 cnv->fromUnicodeStatus=UCNV_NEED_TO_WRITE_BOM;
1184 _UTF16LEOpen(UConverter *cnv,
1187 if(UCNV_GET_VERSION(cnv)<=1) {
1188 _UTF16LEReset(cnv, UCNV_RESET_BOTH);
1195 _UTF16LEGetName(const UConverter *cnv) {
1196 if(UCNV_GET_VERSION(cnv)==0) {
1271 _UTF16Reset(UConverter *cnv, UConverterResetChoice choice) {
1274 cnv->mode=0;
1278 cnv->fromUnicodeStatus=UCNV_NEED_TO_WRITE_BOM;
1285 _UTF16Open(UConverter *cnv,
1288 if(UCNV_GET_VERSION(cnv)<=2) {
1289 if(UCNV_GET_VERSION(cnv)==2 && !pArgs->onlyTestIsLoadable) {
1296 cnv->sharedData=(UConverterSharedData*)&_UTF16v2Data;
1297 uprv_memcpy(cnv->subChars, _UTF16v2Data.staticData->subChar, UCNV_MAX_SUBCHAR_LEN);
1299 _UTF16Reset(cnv, UCNV_RESET_BOTH);
1306 _UTF16GetName(const UConverter *cnv) {
1307 if(UCNV_GET_VERSION(cnv)==0) {
1309 } else if(UCNV_GET_VERSION(cnv)==1) {
1318 #define IS_UTF16BE(cnv) ((cnv)->sharedData==&_UTF16BEData)
1319 #define IS_UTF16LE(cnv) ((cnv)->sharedData==&_UTF16LEData)
1320 #define IS_UTF16(cnv) ((cnv)->sharedData==&_UTF16Data || (cnv)->sharedData==&_UTF16v2Data)
1325 UConverter *cnv=pArgs->converter;
1333 state=cnv->mode;
1345 cnv->toUBytes[0]=(uint8_t)*source++;
1346 cnv->toULength=1;
1357 if(cnv->toUBytes[0]==0xfe && b==0xff) {
1358 if(IS_UTF16LE(cnv)) {
1363 } else if(cnv->toUBytes[0]==0xff && b==0xfe) {
1364 if(IS_UTF16BE(cnv)) {
1369 } else if((IS_UTF16(cnv) && UCNV_GET_VERSION(cnv)==1)) {
1375 cnv->toULength=0;
1382 cnv->toULength=0;
1384 if(IS_UTF16LE(cnv)) {
1399 cnv->toUBytes[1]=b;
1400 cnv->toULength=2;
1408 cnv->mode=state+2;
1413 cnv->mode=state;
1459 cnv->mode=state;