Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1337)

Unified Diff: third_party/WebKit/Source/platform/text/TextEncodingDetector.h

Issue 1721373002: UTF-8 detector for pages missing encoding info (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/text/TextEncodingDetector.h
diff --git a/third_party/WebKit/Source/platform/text/TextEncodingDetector.h b/third_party/WebKit/Source/platform/text/TextEncodingDetector.h
index 12f4890fc3924d65e13de5fece8e5c8482cc968c..6cf3980979c1e4c0dfe73ecc4ec928fc9714fd9b 100644
--- a/third_party/WebKit/Source/platform/text/TextEncodingDetector.h
+++ b/third_party/WebKit/Source/platform/text/TextEncodingDetector.h
@@ -47,6 +47,12 @@ namespace blink {
PLATFORM_EXPORT bool detectTextEncoding(const char* data, size_t length,
const char* hintEncodingName, WTF::TextEncoding* detectedEncoding);
+// Given a sequence of bytes in |data| of length |len|, check if
+// the content is encoded in UTF-8. Pure ASCII text is not regarded
+// as UTF-8 in order to respect the default encoding since it can be
+// of any encoding.
+PLATFORM_EXPORT bool isUTF8Encoded(const char* data, size_t length);
+
} // namespace blink
#endif

Powered by Google App Engine
This is Rietveld 408576698