Bug #66868 --> Location of profile is incorrect shown when the path contains non-ascii chars
Patch by Mike Kaply r=dougt sr=tor git-svn-id: svn://10.0.0.236/trunk@150864 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
#include "nsFileStream.h"
|
||||
|
||||
#include "nsILocalFile.h"
|
||||
#include "nsNativeCharsetUtils.h"
|
||||
|
||||
#include "prmem.h"
|
||||
|
||||
@@ -211,6 +212,34 @@ NS_IMETHODIMP nsFileSpecImpl::SetNativePath(const char * aNativePath)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_IMETHODIMP nsFileSpecImpl::GetUnicodePath(PRUnichar * *aUnicodePath)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
TEST_OUT_PTR(aUnicodePath)
|
||||
nsAutoString unicode;
|
||||
nsCAutoString native;
|
||||
native = mFileSpec.GetNativePathCString();
|
||||
NS_CopyNativeToUnicode(native, unicode);
|
||||
*aUnicodePath = nsCRT::strdup(unicode.get());
|
||||
if (!*aUnicodePath)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_IMETHODIMP nsFileSpecImpl::SetUnicodePath(const PRUnichar * aUnicodePath)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsAutoString unicode;
|
||||
nsCAutoString native;
|
||||
|
||||
unicode = aUnicodePath;
|
||||
NS_CopyUnicodeToNative(unicode, native);
|
||||
mFileSpec = native.get();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_IMETHODIMP nsFileSpecImpl::GetNSPRPath(char * *aNSPRPath)
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user