const nsString fileCharset(nsMsgI18NFileSystemCharset());
const char *fileCharset = nsMsgI18NFileSystemCharset();
nsresult NS_MsgCreatePathStringFromFolderURI(const char *folderURI, nsCString& pathString){	// A file name has to be in native charset, convert from UTF-8.	nsCAutoString oldPath;	const nsString fileCharset(nsMsgI18NFileSystemCharset());	char *nativeString = nsnull;	nsresult rv = ConvertFromUnicode(fileCharset, nsAutoString(NS_ConvertUTF8toUCS2(folderURI)), &nativeString);	if (NS_SUCCEEDED(rv) && nativeString && nativeString[0])		oldPath.Assign(nativeString);	else		oldPath.Assign(folderURI);	PR_FREEIF(nativeString);	nsCAutoString pathPiece;	PRInt32 startSlashPos = oldPath.FindChar('/');	PRInt32 endSlashPos = (startSlashPos >= 0) 		? oldPath.FindChar('/', PR_FALSE, startSlashPos + 1) - 1 : oldPath.Length() - 1;	if (endSlashPos == -1)		endSlashPos = oldPath.Length();    // trick to make sure we only add the path to the first n-1 folders    PRBool haveFirst=PR_FALSE;    while (startSlashPos != -1) {	  oldPath.Mid(pathPiece, startSlashPos + 1, endSlashPos - startSlashPos);      // skip leading '/' (and other // style things)      if (pathPiece.Length() > 0) {        // add .sbd onto the previous path        if (haveFirst) {          pathString+=".sbd";          pathString += "/";        }                NS_MsgHashIfNecessary(pathPiece);        pathString += pathPiece;        haveFirst=PR_TRUE;      }	  // look for the next slash      startSlashPos = endSlashPos + 1;	  endSlashPos = (startSlashPos >= 0) 			? oldPath.FindChar('/', PR_FALSE, startSlashPos + 1)  - 1: oldPath.Length() - 1;	  if (endSlashPos == -1)			endSlashPos = oldPath.Length();      if (startSlashPos == endSlashPos)		  break;    }	return NS_OK;}