Index: third_party/WebKit/Source/wtf/text/UTF8.h |
diff --git a/third_party/WebKit/Source/wtf/text/UTF8.h b/third_party/WebKit/Source/wtf/text/UTF8.h |
index eda2633409ac290fdf75d8fac637f463ae78ddad..d2873148cc2b010e1a64e75c02e47afb3a7fd282 100644 |
--- a/third_party/WebKit/Source/wtf/text/UTF8.h |
+++ b/third_party/WebKit/Source/wtf/text/UTF8.h |
@@ -70,6 +70,12 @@ WTF_EXPORT unsigned calculateStringHashAndLengthFromUTF8MaskingTop8Bits(const ch |
WTF_EXPORT bool equalUTF16WithUTF8(const UChar* a, const UChar* aEnd, const char* b, const char* bEnd); |
WTF_EXPORT bool equalLatin1WithUTF8(const LChar* a, const LChar* aEnd, const char* b, const char* bEnd); |
+ |
+// 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. |
+WTF_EXPORT bool isUTF8Encoded(const char* data, size_t length); |
+ |
} // namespace Unicode |
} // namespace WTF |