diff --git a/toolkit/xre/nsNativeAppSupportWin.cpp b/toolkit/xre/nsNativeAppSupportWin.cpp index b07962e5edad..c2264f7a19fe 100644 --- a/toolkit/xre/nsNativeAppSupportWin.cpp +++ b/toolkit/xre/nsNativeAppSupportWin.cpp @@ -76,6 +76,7 @@ #include "nsIJSContextStack.h" #include "nsIWebNavigation.h" #include "nsIWindowMediator.h" +#include "nsNativeCharsetUtils.h" #include #include @@ -1090,12 +1091,15 @@ nsNativeAppSupportWin::HandleDDENotification( UINT uType, // transaction t nsCAutoString outpt( NS_LITERAL_CSTRING("\"") ); // Now copy the URL converting the Unicode string // to a single-byte ASCII string - outpt.Append( NS_LossyConvertUCS2toASCII( url ) ); + nsCAutoString tmpNativeStr; + NS_CopyUnicodeToNative( url, tmpNativeStr ); + outpt.Append( tmpNativeStr ); // Add the "," used to separate the URL and the page // title outpt.Append( NS_LITERAL_CSTRING("\",\"") ); // Now copy the current page title to the return string - outpt.Append( NS_LossyConvertUCS2toASCII( title.get() )); + NS_CopyUnicodeToNative( title, tmpNativeStr ); + outpt.Append( tmpNativeStr ); // Fill out the return string with the remainin ","" outpt.Append( NS_LITERAL_CSTRING( "\",\"\"" )); diff --git a/xpfe/bootstrap/nsNativeAppSupportWin.cpp b/xpfe/bootstrap/nsNativeAppSupportWin.cpp index 79a576b3f0e0..ea750d0cf165 100644 --- a/xpfe/bootstrap/nsNativeAppSupportWin.cpp +++ b/xpfe/bootstrap/nsNativeAppSupportWin.cpp @@ -72,6 +72,7 @@ #include "nsIObserverService.h" #include "nsXPCOM.h" #include "nsXPFEComponentsCID.h" +#include "nsNativeCharsetUtils.h" struct JSContext; @@ -1511,12 +1512,15 @@ nsNativeAppSupportWin::HandleDDENotification( UINT uType, // transaction t nsCAutoString outpt( NS_LITERAL_CSTRING("\"") ); // Now copy the URL converting the Unicode string // to a single-byte ASCII string - outpt.Append( NS_LossyConvertUTF16toASCII( url ) ); + nsCAutoString tmpNativeStr; + NS_CopyUnicodeToNative( url, tmpNativeStr ); + outpt.Append( tmpNativeStr ); // Add the "," used to separate the URL and the page // title outpt.Append( NS_LITERAL_CSTRING("\",\"") ); // Now copy the current page title to the return string - outpt.Append( NS_LossyConvertUTF16toASCII( title )); + NS_CopyUnicodeToNative( title, tmpNativeStr ); + outpt.Append( tmpNativeStr ); // Fill out the return string with the remainin ","" outpt.Append( NS_LITERAL_CSTRING( "\",\"\"" ));