зеркало из https://github.com/mozilla/gecko-dev.git
a part of bug 162765 (r=cbiesinger, sr=alecf) missed in the previous commit.
RFC 2231 support (with RFC 2047 fallback) in Content-Disposition header in http for file download.
This commit is contained in:
Родитель
ca2d793e9e
Коммит
245a450695
|
@ -77,7 +77,7 @@ ToUTF8(const nsACString &aString, const char *aCharset, nsACString &aResult)
|
|||
|
||||
rv = unicodeDecoder->Convert(inStr.get(), &srcLen, ustr, &dstLen);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
CopyUTF16toUTF8(nsDependentString(ustr, dstLen), aResult);
|
||||
CopyUTF16toUTF8(Substring(ustr, ustr + dstLen), aResult);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -157,6 +157,7 @@ nsMIMEHeaderParamImpl::GetParameterInternal(const char *aHeaderValue,
|
|||
if (str == start)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
*aResult = (char *) nsMemory::Clone(start, (str - start) + 1);
|
||||
(*aResult)[str - start] = '\0'; // null-terminate
|
||||
NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -589,7 +590,7 @@ void CopyRawHeader(const char *aInput, PRUint32 aLen,
|
|||
nsCAutoString utf8Text;
|
||||
if (NS_SUCCEEDED(rv) &&
|
||||
NS_SUCCEEDED(
|
||||
cvtUTF8->ConvertStringToUTF8(nsDependentCString(aInput, aLen),
|
||||
cvtUTF8->ConvertStringToUTF8(Substring(aInput, aInput + aLen),
|
||||
aDefaultCharset, skipCheck, utf8Text))) {
|
||||
aOutput.Append(utf8Text);
|
||||
} else { // replace each octet with Unicode replacement char in UTF-8.
|
||||
|
|
Загрузка…
Ссылка в новой задаче