Return success code not failure code when GetDefaultCharsetForLocale returns a fallback charset. Bug 653750, r=emk
authorSimon Montagu <smontagu@smontagu.org>
Mon, 11 Jul 2011 18:53:55 +0300
changeset 73414 cd6c4d5c4ff507750221df8ff1638d73b5751d6e
parent 73413 8753de11b181b8cf318783591bd4936d37f22f2f
child 73415 f7f3f4ad573c9b6dc05d3fac53b476f9d3e1dc63
push id235
push userbzbarsky@mozilla.com
push dateTue, 27 Sep 2011 17:13:04 +0000
treeherdermozilla-beta@2d1e082d176a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemk
bugs653750
milestone8.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Return success code not failure code when GetDefaultCharsetForLocale returns a fallback charset. Bug 653750, r=emk
intl/locale/src/windows/nsWinCharset.cpp
--- a/intl/locale/src/windows/nsWinCharset.cpp
+++ b/intl/locale/src/windows/nsWinCharset.cpp
@@ -41,16 +41,17 @@
 #include <windows.h>
 #include "nsWin32Locale.h"
 #include "nsCOMPtr.h"
 #include "nsReadableUtils.h"
 #include "nsLocaleCID.h"
 #include "nsServiceManagerUtils.h"
 #include "nsITimelineService.h"
 #include "nsPlatformCharset.h"
+#include "nsEncoderDecoderUtils.h"
 
 static const char* kWinCharsets[][3] = {
 #include "wincharset.properties.h"
 };
 
 NS_IMPL_ISUPPORTS1(nsPlatformCharset, nsIPlatformCharset)
 
 nsPlatformCharset::nsPlatformCharset()
@@ -74,16 +75,17 @@ nsPlatformCharset::MapToCharset(nsAStrin
 {
   nsCAutoString key;
   LossyCopyUTF16toASCII(inANSICodePage, key);
 
   nsresult rv = nsUConvPropertySearch::SearchPropertyValue(kWinCharsets,
       NS_ARRAY_LENGTH(kWinCharsets), key, outCharset);
   if (NS_FAILED(rv)) {
     outCharset.AssignLiteral("windows-1252");
+    return NS_SUCCESS_USING_FALLBACK_LOCALE;
   }
   return rv;
 }
 
 NS_IMETHODIMP 
 nsPlatformCharset::GetCharset(nsPlatformCharsetSel selector,
                               nsACString& oResult)
 {