Bug 306310 explicitly specify the charset (as UTF-8) for the about: channels

r+sr=darin
This commit is contained in:
cbiesinger%web.de 2005-08-31 14:32:19 +00:00
parent 2f3c0b7029
commit b4c780f6ed
4 changed files with 9 additions and 5 deletions

View File

@ -57,7 +57,8 @@ nsAboutBlank::NewChannel(nsIURI *aURI, nsIChannel **result)
if (NS_FAILED(rv)) return rv;
rv = NS_NewInputStreamChannel(&channel, aURI, in,
NS_LITERAL_CSTRING("text/html"));
NS_LITERAL_CSTRING("text/html"),
NS_LITERAL_CSTRING("utf-8"));
if (NS_FAILED(rv)) return rv;
*result = channel;

View File

@ -148,7 +148,8 @@ nsAboutBloat::NewChannel(nsIURI *aURI, nsIChannel **result)
nsIChannel* channel;
rv = NS_NewInputStreamChannel(&channel, aURI, inStr,
NS_LITERAL_CSTRING("text/plain"));
NS_LITERAL_CSTRING("text/plain"),
NS_LITERAL_CSTRING("utf-8"));
if (NS_FAILED(rv)) return rv;
*result = channel;

View File

@ -148,7 +148,8 @@ nsAboutCache::NewChannel(nsIURI *aURI, nsIChannel **result)
nsIChannel* channel;
rv = NS_NewInputStreamChannel(&channel, aURI, inStr,
NS_LITERAL_CSTRING("text/html"));
NS_LITERAL_CSTRING("text/html"),
NS_LITERAL_CSTRING("utf-8"));
if (NS_FAILED(rv)) return rv;
*result = channel;

View File

@ -68,7 +68,8 @@ nsAboutCacheEntry::NewChannel(nsIURI *aURI, nsIChannel **result)
nsCOMPtr<nsIChannel> chan;
rv = NS_NewInputStreamChannel(getter_AddRefs(chan), aURI, nsnull,
NS_LITERAL_CSTRING("application/xhtml+xml"));
NS_LITERAL_CSTRING("application/xhtml+xml"),
NS_LITERAL_CSTRING("utf-8"));
if (NS_FAILED(rv)) return rv;
mStreamChannel = do_QueryInterface(chan, &rv);
@ -476,7 +477,7 @@ nsAboutCacheEntry::WriteCacheEntryDescription(nsIOutputStream *outputStream,
if (NS_SUCCEEDED(rv)) {
nsAutoString filePath;
cacheFile->GetPath(filePath);
APPEND_ROW("file on disk", NS_ConvertUCS2toUTF8(filePath));
APPEND_ROW("file on disk", NS_ConvertUTF16toUTF8(filePath));
}
else
APPEND_ROW("file on disk", "none");