if (lastEncoding != INVALID_ENCODING_ID)
if (lastEncoding != (INTL_Encoding_ID) INVALID_ENCODING_ID)
PUBLIC void    INTL_UnicodeToStr(    INTL_Encoding_ID encoding,    INTL_Unicode*    ustr,    uint32 			 ustrlen,    unsigned char*   dest,    uint32           destbuflen){#define INVALID_ENCODING_ID	-999	uint16 u;	uint16 med;	uint32 cur;	static uint16			num;	static uTableSet		tableset;	static INTL_Encoding_ID	lastEncoding = (INTL_Encoding_ID)INVALID_ENCODING_ID;	if (encoding != lastEncoding)	{		/* Unload all the table we need */		if (lastEncoding != INVALID_ENCODING_ID)			UnloadUCS2TableSet(&tableset,TRUE);		/* load all the table we need */		num = LoadUCS2TableSet(encoding, &tableset,TRUE);		lastEncoding = encoding;	}	/* For every character */	for(cur=0; cur < ustrlen ;cur++)	{		int i;		u = (*ustr++);#ifdef XP_MAC		if(u == 0x000a)			u = 0x000d;#endif	/* Loop to every table it need to convert */		for(i=0;i<num;i++)		{			if((tableset.tables[i] != NULL) &&			   (uMapCode(tableset.tables[i],u, &med)))					break;		}		if(i!=num)		{			uint16 outlen;			XP_Bool ret;			/* MAP one, gen it */			ret = uGenerate(tableset.shift[i], 				(int32*)0, 				med, 				dest,				(uint16)destbuflen, 				&outlen);			XP_ASSERT(ret);			dest+=outlen;			destbuflen += outlen;		}		else		{			/* Ok! right before we fall back. We take care C0 area here */			if(u <= 0x0020)			{				/* cannot map one, gen the fallback */				*dest++ = (unsigned char)u;				destbuflen--;			}			else			{							XP_ASSERT(destbuflen > 1);				/* cannot map one, gen the fallback */				*dest++ = '?';				destbuflen--;			}		}	}	XP_ASSERT(destbuflen > 0);	*dest = '\0';	/* NULL terminate it */}