uField.AssignWithConversion( field);
uField.AssignWithConversion( field.get());
NS_IMETHODIMP ImportAddressImpl::GetSampleData( PRInt32 index, PRBool *pFound, PRUnichar **pStr){    NS_PRECONDITION(pFound != nsnull, "null ptr");    NS_PRECONDITION(pStr != nsnull, "null ptr");	if (!pFound || !pStr)		return( NS_ERROR_NULL_POINTER);		if (!m_fileLoc) {		IMPORT_LOG0( "*** Error, called GetSampleData before SetSampleLocation\n");		return( NS_ERROR_FAILURE);	}	nsresult	rv;	*pStr = nsnull;	PRBool		open = PR_FALSE;	PRUnichar	term = 0;	if (!m_haveDelim) {		rv = m_fileLoc->IsStreamOpen( &open);		if (open) {			m_fileLoc->CloseStream();			open = PR_FALSE;		}		rv = m_text.DetermineDelim( m_fileLoc);		if (NS_FAILED( rv))			return( rv);		m_haveDelim = PR_TRUE;		m_delim = m_text.GetDelim();	}	else {		rv = m_fileLoc->IsStreamOpen( &open);				}		if (!open) {		rv = m_fileLoc->OpenStreamForReading();		if (NS_FAILED( rv)) {			*pFound = PR_FALSE;			*pStr = nsCRT::strdup( &term);			return( NS_OK);		}	}		PRInt32	lineLen;	PRInt32	bufSz = 10240;	char	*pLine = new char[bufSz];		nsCOMPtr<nsIImportService> impSvc(do_GetService(kImportServiceCID, &rv));	rv = nsTextAddress::ReadRecordNumber( m_fileLoc, pLine, bufSz, m_delim, &lineLen, index);	if (NS_SUCCEEDED( rv)) {		nsString	str;		nsCString	field;		nsString	uField;		PRInt32		fNum = 0;		while (nsTextAddress::GetField( pLine, lineLen, fNum, field, m_delim)) {			if (fNum)				str.AppendWithConversion( "\n");			SanitizeSampleData( field);			if (impSvc)				impSvc->SystemStringToUnicode( field, uField);			else				uField.AssignWithConversion( field);			str.Append( uField);			fNum++;			field.Truncate();		}		*pStr = nsCRT::strdup( str.get());		*pFound = PR_TRUE;		/* IMPORT_LOG1( "Sample data: %S\n", str.get()); */	}	else {		*pFound = PR_FALSE;		*pStr = nsCRT::strdup( &term);	}	delete [] pLine;	return( NS_OK);}