mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 801402 - Use FindEncodingForLabel from OS.File. r=sicking
This commit is contained in:
parent
b7bc4daca4
commit
987290239c
@ -12,7 +12,6 @@
|
||||
#include "nsISeekableStream.h"
|
||||
|
||||
#include "jsfriendapi.h"
|
||||
#include "nsCharsetAlias.h"
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsDOMClassInfoID.h"
|
||||
@ -33,9 +32,12 @@
|
||||
#include "nsError.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
#include "mozilla/dom/EncodingUtils.h"
|
||||
|
||||
#define STREAM_COPY_BLOCK_SIZE 32768
|
||||
|
||||
USING_FILE_NAMESPACE
|
||||
using mozilla::dom::EncodingUtils;
|
||||
|
||||
namespace {
|
||||
|
||||
@ -1054,8 +1056,9 @@ ReadTextHelper::GetSuccessResult(JSContext* aCx,
|
||||
}
|
||||
|
||||
nsCString charset;
|
||||
rv = nsCharsetAlias::GetPreferred(charsetGuess, charset);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (!EncodingUtils::FindEncodingForLabel(charsetGuess, charset)) {
|
||||
return NS_ERROR_DOM_ENCODING_NOT_SUPPORTED_ERR;
|
||||
}
|
||||
|
||||
nsString tmpString;
|
||||
rv = nsContentUtils::ConvertStringFromCharset(charset, mStream->Data(),
|
||||
|
Loading…
Reference in New Issue
Block a user