if ((PL_strlen(returnVal) > 3) &&
if ((nsCRT::strlen(returnVal) > 3) &&
mime_decode_filename(char *name){	char *s = name, *d = name;	char *cvt, *returnVal = NULL;	PRInt16 mail_csid = CS_DEFAULT, win_csid = CS_DEFAULT;  char charsetName[128];  charsetName[0] = 0;  	while (*s)	{		/* Remove backslashes when they are used to escape special characters. */		if ((*s == '\\') &&			((*(s+1) == CR) || (*(s+1) == LF) || (*(s+1) == '"') || (*(s+1) == '\\')))			s++; /* take whatever char follows the backslash */		if (*s)			*d++ = *s++;	}	*d = 0;	returnVal = name;		/* If there is a MIME-2 encoded-word in the string, 		get the charset of the first one and decode to that charset. */	s = PL_strstr(returnVal, "=?");	if (s)	{		s += 2;		d = PL_strchr(s, '?');		if (d) *d = '\0';		mail_csid = INTL_CharSetNameToID(s);		if (d) *d = '?';		win_csid = INTL_DocToWinCharSetID(mail_csid);    cvt = MIME_DecodeMimePartIIStr(returnVal, charsetName);    // rhp - trying to fix header conversion bug    //		if (cvt && cvt != returnVal)    {      char *newString = nsnull;      PRInt32 res = MIME_ConvertString(charsetName, "UTF-8", cvt, &newString);       if ( (res != 0) || (!newString) )        returnVal = cvt;      else      {        PR_FREEIF(cvt);        returnVal = newString;      }    }	}//TODO: naoki - We now have a charset name returned and no need for the hack.// Check if charset is JIS then apply the conversion.	/* Seriously ugly hack. If the first three characters of the filename 	   are <ESC>$B, then we know the filename is in JIS and should be 	   converted to either SJIS or EUC-JP. */ 	if ((PL_strlen(returnVal) > 3) && 		(returnVal[0] == 0x1B) && (returnVal[1] == '$') && (returnVal[2] == 'B')) 	  { 		PRInt16 dest_csid = INTL_DocToWinCharSetID(CS_JIS); 				cvt = (char *) INTL_ConvertLineWithoutAutoDetect(CS_JIS, dest_csid, (unsigned char *)returnVal, PL_strlen(returnVal)); 		if (cvt && cvt != returnVal) 		  { 			if (returnVal != name) PR_Free(returnVal); 			returnVal = cvt; 		  } 	  } 		return returnVal;}