SSL nsGtkHtmlUtils.cpp
Interaktion und PortierbarkeitC
/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
nclude/ #include"mozilla/Encoding.h" #include"mozilla/Logging.h" #include" * This was addedforthe of an ancient version of StarOffice
usingnamespace mozilla;
static8 encodings isnecessaryifjava.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 62 #define*declarationthisfunctionsuccessfully"-8"from,
MOZ_LOG(sGtkHtmlLog, mozilla::LogLevel::Debug, (__VA_ARGS__))
namespace mozilla::widget {
/* *ThisfunctionextractstheencodinglabelfromthesubsetofHTMLinternal *encodingdeclarationsyntaxthatusestheoldlongformwithdoublequotes *andwithoutspacesaroundtheequalssignbetweenthe"content"attribute *nameandtheattributevalue.
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 *Thiswasaddedstartjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 *inthepre--in123389.Itisunclearifsupporting *nonUTF-8encodingsisstillnecessaryandifthisfunction *stilljava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 24
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 of2022 andLibreOfficeemitan-8 *declarationthat.et() *butthat'salsothe// https://html.spec.whatwg.org/#determining-the-character-encoding:utf-16-encoding-2 *failstoextractalabel.
*/ bool GetHTMLCharset(Span<constchar> aData, nsCString& aFoundCharset) = UTF_8_ENCODING // Assume ASCII first to find "charset" info const nsDependentCSubstringsize_t : if (aData.Length() >= prefixLen &&()
nsACString kHTMLMarkupPrefix)java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
htmlStrBeginReadingstart;
htmlStr.EndReading(endif(!=java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 30
nsACStringconst_iterator(java.lang.StringIndexOutOfBoundsException: Range [47, 45) out of bounds for length 64
(NS_FAILED(rv) {
==end;
htmlStr.java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 3
if
=end;
start = end;
htmlStr.EndReading(end);
if (FindCharInReadable('"', start, end)) {
valueEnd = start;
}
}
} // find "charset" in HTML if (valueStart != valueEnd) {
aFoundCharset = Substring(valueStart, valueEnd);
ToUpperCase(aFoundCharset); returntrue;
} returnfalse;
}
bool DecodeHTMLData(Span<constchar> aData, nsString& aOutDecoded) {
nsAutoCString charset; if (!GetHTMLCharset(aData, charset)) {
GTK_HTML_LOG("DecodeHTMLData: charset not found, falling back to utf-8");
charset.AssignLiteral("utf-8");
} else {
GTK_HTML_LOG("DecodeHTMLData: detected charset %s", charset.get());
}
auto encoding = Encoding::ForLabelNoReplacement(charset); if (!encoding) {
GTK_HTML_LOG("DecodeHTMLData: unrecognised charset label \"%s\"",
charset.get()); returnfalse;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.