/*
*******************************************************************************
*
-* Copyright (C) 2003-2007, International Business Machines
+* Copyright (C) 2003-2013, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
utm_close(extData->fromUTableUChars);
utm_close(extData->fromUTableValues);
utm_close(extData->fromUBytes);
+ uprv_free(extData);
}
}
/* allocate it and put its length and index into the value */
value=
- (((uint32_t)m->uLen+UCNV_EXT_TO_U_LENGTH_OFFSET)<<UCNV_EXT_TO_U_LENGTH_SHIFT)|
+ (((uint32_t)u16Length+UCNV_EXT_TO_U_LENGTH_OFFSET)<<UCNV_EXT_TO_U_LENGTH_SHIFT)|
((uint32_t)utm_countItems(extData->toUUChars));
u=utm_allocN(extData->toUUChars, u16Length);
flag&=MBCS_FROM_U_EXT_MASK;
m->f=flag;
}
- if(flag==0 || flag==1 || (flag==2 && m->bLen==1)) {
+ if(flag==0 || flag==1 || (flag==2 && m->bLen==1) || flag==4) {
map[j++]=i;
if(m->uLen>1) {
value|=(uint32_t)m->bLen<<UCNV_EXT_FROM_U_LENGTH_SHIFT;
if(m->f==0) {
value|=UCNV_EXT_FROM_U_ROUNDTRIP_FLAG;
+ } else if(m->f==4) {
+ value|=UCNV_EXT_FROM_U_GOOD_ONE_WAY_FLAG;
}
/* calculate the real UTF-16 length (see recoding in prepareFromUMappings()) */