mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
back out previous check-in b=309335
This commit is contained in:
parent
4661df8775
commit
4632dfa33b
@ -51,7 +51,6 @@
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "nsIPrefBranch2.h"
|
||||
#include "nsIIDNService.h"
|
||||
#include "nsIPlatformCharset.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "prlog.h"
|
||||
#include "nsAutoPtr.h"
|
||||
@ -2455,14 +2454,7 @@ nsStandardURL::SetFile(nsIFile *file)
|
||||
rv = net_GetURLSpecFromFile(file, url);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// We should always set the charset until bug 278161 is fixed.
|
||||
nsCOMPtr <nsIPlatformCharset> platformCharset =
|
||||
do_GetService(NS_PLATFORMCHARSET_CONTRACTID);
|
||||
nsCAutoString charset;
|
||||
if (platformCharset)
|
||||
platformCharset->GetCharset(kPlatformCharsetSel_FileName, charset);
|
||||
|
||||
rv = Init(mURLType, mDefaultPort, url, charset.get(), nsnull);
|
||||
rv = SetSpec(url);
|
||||
|
||||
// must clone |file| since its value is not guaranteed to remain constant
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
|
@ -46,7 +46,6 @@
|
||||
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIPlatformCharset.h"
|
||||
|
||||
#include "nsNetUtil.h"
|
||||
|
||||
@ -270,15 +269,8 @@ nsFileProtocolHandler::NewURI(const nsACString &spec,
|
||||
specPtr = &buf;
|
||||
#endif
|
||||
|
||||
nsCAutoString urlCharset;
|
||||
// We should set file system charset until bug 278161 is fixed.
|
||||
nsCOMPtr <nsIPlatformCharset> platformCharset =
|
||||
do_GetService(NS_PLATFORMCHARSET_CONTRACTID);
|
||||
if (platformCharset) {
|
||||
platformCharset->GetCharset(kPlatformCharsetSel_FileName, urlCharset);
|
||||
if (!urlCharset.IsEmpty())
|
||||
charset = urlCharset.get();
|
||||
}
|
||||
// XXX perhaps we should convert |charset| to whatever the system charset
|
||||
// is so that nsStandardURL will normalize our URL string properly?
|
||||
|
||||
nsresult rv = url->Init(nsIStandardURL::URLTYPE_NO_AUTHORITY, -1,
|
||||
*specPtr, charset, baseURI);
|
||||
@ -341,8 +333,8 @@ nsFileProtocolHandler::NewFileURI(nsIFile *file, nsIURI **result)
|
||||
if (!url)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
// NOTE: the origin charset is assigned the value of the platform
|
||||
// charset by the SetFile method.
|
||||
// XXX shouldn't we set nsIURI::originCharset ??
|
||||
|
||||
rv = url->SetFile(file);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user