зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1240436 - Part1: Convert UTF16 to UTF8 before generating nsStringInputStream. r=khuey
This commit is contained in:
Родитель
ff6e350e2e
Коммит
aa7c2fc2bd
|
@ -451,7 +451,7 @@ ExtractFromURLSearchParams(const URLSearchParams& aParams,
|
|||
nsAutoString serialized;
|
||||
aParams.Stringify(serialized);
|
||||
aContentType = NS_LITERAL_CSTRING("application/x-www-form-urlencoded;charset=UTF-8");
|
||||
return NS_NewStringInputStream(aStream, serialized);
|
||||
return NS_NewCStringInputStream(aStream, NS_ConvertUTF16toUTF8(serialized));
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
|
|
@ -537,7 +537,8 @@ private:
|
|||
|
||||
ErrorResult result;
|
||||
nsCOMPtr<nsIInputStream> body;
|
||||
result = NS_NewStringInputStream(getter_AddRefs(body), mCN->Buffer());
|
||||
result = NS_NewCStringInputStream(getter_AddRefs(body),
|
||||
NS_ConvertUTF16toUTF8(mCN->Buffer()));
|
||||
if (NS_WARN_IF(result.Failed())) {
|
||||
MOZ_ASSERT(!result.IsErrorWithMessage());
|
||||
Fail(result.StealNSResult());
|
||||
|
|
Загрузка…
Ссылка в новой задаче