mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 615595. Set the form submission's mCharset to the charset we're actually using to encode the data. r=sicking
This commit is contained in:
parent
539252559a
commit
62f1a60074
@ -718,15 +718,8 @@ nsEncodingFormSubmission::nsEncodingFormSubmission(const nsACString& aCharset,
|
||||
charset.AssignLiteral("windows-1252");
|
||||
}
|
||||
|
||||
// use UTF-8 for UTF-16* (per WHATWG and existing practice of
|
||||
// MS IE/Opera).
|
||||
if (StringBeginsWith(charset, NS_LITERAL_CSTRING("UTF-16"))) {
|
||||
charset.AssignLiteral("UTF-8");
|
||||
}
|
||||
|
||||
if (!(charset.EqualsLiteral("UTF-8") || charset.EqualsLiteral("gb18030"))) {
|
||||
nsAutoString charsetUtf16;
|
||||
CopyUTF8toUTF16(charset, charsetUtf16);
|
||||
NS_ConvertUTF8toUTF16 charsetUtf16(charset);
|
||||
const PRUnichar* charsetPtr = charsetUtf16.get();
|
||||
SendJSWarning(aOriginatingElement ? aOriginatingElement->GetOwnerDocument()
|
||||
: nsnull,
|
||||
@ -869,6 +862,15 @@ GetSubmissionFromForm(nsGenericHTMLElement* aForm,
|
||||
nsCAutoString charset;
|
||||
GetSubmitCharset(aForm, charset);
|
||||
|
||||
// We now have a canonical charset name, so we only have to check it
|
||||
// against canonical names.
|
||||
|
||||
// use UTF-8 for UTF-16* (per WHATWG and existing practice of
|
||||
// MS IE/Opera).
|
||||
if (StringBeginsWith(charset, NS_LITERAL_CSTRING("UTF-16"))) {
|
||||
charset.AssignLiteral("UTF-8");
|
||||
}
|
||||
|
||||
// Choose encoder
|
||||
if (method == NS_FORM_METHOD_POST &&
|
||||
enctype == NS_FORM_ENCTYPE_MULTIPART) {
|
||||
|
@ -272,6 +272,7 @@ _TEST_FILES = \
|
||||
test_bug674558.html \
|
||||
test_bug583533.html \
|
||||
test_restore_from_parser_fragment.html \
|
||||
test_bug615595.html \
|
||||
test_bug617528.html \
|
||||
test_bug660959-1.html \
|
||||
test_bug660959-2.html \
|
||||
|
BIN
content/html/content/test/test_bug615595.html
Normal file
BIN
content/html/content/test/test_bug615595.html
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user