From f45efafacfc9c4e033dd6777bc9f985a76eedd66 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 19 Aug 2014 16:21:49 +0200 Subject: [PATCH] QTextCodec::codecForHtml looks at the first 1024 bytes The HTML 5 spec requires it, instead of only looking at the first 512. Task-number: QTBUG-40383 Change-Id: Ie10cf8c745ed1a3402914e126a02bc43d5035fff Reviewed-by: Mitch Curtis --- src/corelib/codecs/qtextcodec.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index 7e3e629c47..9bce7bf614 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -1045,7 +1045,7 @@ QTextCodec *QTextCodec::codecForHtml(const QByteArray &ba, QTextCodec *defaultCo // determine charset QTextCodec *c = QTextCodec::codecForUtfText(ba, 0); if (!c) { - QByteArray header = ba.left(512).toLower(); + QByteArray header = ba.left(1024).toLower(); int pos = header.indexOf("meta "); if (pos != -1) { pos = header.indexOf("charset=", pos);