mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-30 11:07:29 +09:00
Issue #1467 - Part 3: Use UTF-8 file paths for NSS-SQL database.
This commit is contained in:
parent
7e3528b551
commit
ff29b77edc
1 changed files with 11 additions and 2 deletions
|
|
@ -1706,16 +1706,25 @@ GetNSSProfilePath(nsAutoCString& aProfilePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(XP_WIN)
|
#if defined(XP_WIN)
|
||||||
// Native path will drop Unicode characters that cannot be mapped to system's
|
|
||||||
// codepage, using short (canonical) path as workaround.
|
|
||||||
nsCOMPtr<nsILocalFileWin> profileFileWin(do_QueryInterface(profileFile));
|
nsCOMPtr<nsILocalFileWin> profileFileWin(do_QueryInterface(profileFile));
|
||||||
if (!profileFileWin) {
|
if (!profileFileWin) {
|
||||||
MOZ_LOG(gPIPNSSLog, LogLevel::Error,
|
MOZ_LOG(gPIPNSSLog, LogLevel::Error,
|
||||||
("Could not get nsILocalFileWin for profile directory.\n"));
|
("Could not get nsILocalFileWin for profile directory.\n"));
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
rv = profileFileWin->GetNativeCanonicalPath(aProfilePath);
|
#ifdef NSS_SQLSTORE
|
||||||
|
// SQLite always takes UTF-8 file paths regardless of the current system
|
||||||
|
// code page.
|
||||||
|
nsAutoString u16ProfilePath;
|
||||||
|
rv = profileFileWin->GetCanonicalPath(u16ProfilePath);
|
||||||
|
CopyUTF16toUTF8(u16ProfilePath, aProfilePath);
|
||||||
#else
|
#else
|
||||||
|
// Native path will drop Unicode characters that cannot be mapped to system's
|
||||||
|
// codepage, using short (canonical) path as workaround.
|
||||||
|
rv = profileFileWin->GetNativeCanonicalPath(aProfilePath);
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
// On non-Windows, just get the native profile path.
|
||||||
rv = profileFile->GetNativePath(aProfilePath);
|
rv = profileFile->GetNativePath(aProfilePath);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue