*aURL = escPath.ToNewCString();
*aURL = ToNewCString(escPath);
hack_nsIFile2URL(nsIFile* file, char * *aURL){    nsresult rv;    char* ePath;    rv = file->GetPath(&ePath);    if (NS_FAILED(rv)) return rv;#if defined (XP_PC)    // Replace \ with / to convert to an url    char* s = ePath;    while (*s) {#ifndef XP_OS2        // We need to call IsDBCSLeadByte because        // Japanese windows can have 0x5C in the sencond byte         // of a Japanese character, for example 0x8F 0x5C is        // one Japanese character        if(::IsDBCSLeadByte(*s) && *(s+1) != nsnull) {            s++;        } else #endif            if (*s == '\\')                *s = '/';        s++;    }#endif#if defined( XP_MAC )    // Swap the / and colons to convert to an url    SwapSlashColon(ePath);#endif    // Escape the path with the directory mask    nsCAutoString tmp(ePath);    tmp.ReplaceChar(":", '|');#ifdef XP_MAC    nsCAutoString escPath("file:///");#else    nsCAutoString escPath("file://");#endif	escPath += tmp;//    rv = nsURLEscape(ePath,nsIIOService::url_Directory + nsIIOService::url_Forced, escPath);//    if (NS_SUCCEEDED(rv)) {        PRBool dir;        rv = file->IsDirectory(&dir);        if (NS_SUCCEEDED(rv) && dir && escPath[escPath.Length() - 1] != '/') {            // make sure we have a trailing slash            escPath += "/";        }        *aURL = escPath.ToNewCString();        if (*aURL == nsnull) {            nsMemory::Free(ePath);            return NS_ERROR_OUT_OF_MEMORY;        }//    }    nsMemory::Free(ePath);    return rv;}