diff options
author | Matt A. Tobin <email@mattatobin.com> | 2022-04-09 16:53:51 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2022-04-09 16:53:51 -0500 |
commit | e9f12148e7f0559e4ed3d383f06bd86f8ef53039 (patch) | |
tree | e76657cd971745536c9bb6c9e9c9cf8c25869787 /xpcom | |
parent | 834e49ea9adfb3f8c681f9d33b881dda964b1ef2 (diff) | |
download | aura-central-e9f12148e7f0559e4ed3d383f06bd86f8ef53039.tar.gz |
Revert "Revert "Issue %3057 - Part 7: Convert GetNativePath to a lossless version.""
This reverts commit 8eb559895d0cd5640c05903513c9c5f310fb5431.
Diffstat (limited to 'xpcom')
-rw-r--r-- | xpcom/io/nsLocalFileWin.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/xpcom/io/nsLocalFileWin.cpp b/xpcom/io/nsLocalFileWin.cpp index 2ff05666b..297fd9cca 100644 --- a/xpcom/io/nsLocalFileWin.cpp +++ b/xpcom/io/nsLocalFileWin.cpp @@ -3564,13 +3564,15 @@ nsLocalFile::SetNativeLeafName(const nsACString& aLeafName) NS_IMETHODIMP nsLocalFile::GetNativePath(nsACString& aResult) { - //NS_WARNING("This API is lossy. Use GetPath !"); + // Note: As of #3057 this function is a bit of a misnomer as it ignores + // clamped code pages and converts to UTF-8 at all times. + // This makes it losless but incompatible with filesystems using + // codepage encoding; this should not be an issue on supported Win versions. nsAutoString tmp; nsresult rv = GetPath(tmp); if (NS_SUCCEEDED(rv)) { - rv = NS_CopyUnicodeToNative(tmp, aResult); + CopyUTF16toUTF8(tmp, aResult); } - return rv; } |