From 01bdf114caed96e4ac31f496fc6b0357a2999fea Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sat, 9 Apr 2022 16:54:15 -0500 Subject: Revert "Issue %3057 - Part 8: Convert other Native cases to lossless versions." This reverts commit 756cfe85af63d4899182bc678af6d18d77a62351. --- xpcom/io/nsLocalFileWin.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'xpcom') diff --git a/xpcom/io/nsLocalFileWin.cpp b/xpcom/io/nsLocalFileWin.cpp index 68824bf66..297fd9cca 100644 --- a/xpcom/io/nsLocalFileWin.cpp +++ b/xpcom/io/nsLocalFileWin.cpp @@ -3538,10 +3538,11 @@ nsLocalFile::AppendRelativeNativePath(const nsACString& aNode) NS_IMETHODIMP nsLocalFile::GetNativeLeafName(nsACString& aLeafName) { + //NS_WARNING("This API is lossy. Use GetLeafName !"); nsAutoString tmp; nsresult rv = GetLeafName(tmp); if (NS_SUCCEEDED(rv)) { - rv = CopyUTF16toUTF8(tmp, aLeafName); + rv = NS_CopyUnicodeToNative(tmp, aLeafName); } return rv; @@ -3565,7 +3566,7 @@ nsLocalFile::GetNativePath(nsACString& aResult) { // 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 lossless but incompatible with filesystems using + // 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); @@ -3579,8 +3580,9 @@ nsLocalFile::GetNativePath(nsACString& aResult) NS_IMETHODIMP nsLocalFile::GetNativeCanonicalPath(nsACString& aResult) { + NS_WARNING("This method is lossy. Use GetCanonicalPath !"); EnsureShortPath(); - CopyUTF16toUTF8(mShortWorkingPath, aResult); + NS_CopyUnicodeToNative(mShortWorkingPath, aResult); return NS_OK; } @@ -3646,10 +3648,11 @@ nsLocalFile::GetNativeTarget(nsACString& aResult) // Check we are correctly initialized. CHECK_mWorkingPath(); + NS_WARNING("This API is lossy. Use GetTarget !"); nsAutoString tmp; nsresult rv = GetTarget(tmp); if (NS_SUCCEEDED(rv)) { - rv = CopyUTF16toUTF8(tmp, aResult); + rv = NS_CopyUnicodeToNative(tmp, aResult); } return rv; -- cgit v1.2.3