| Index: third_party/WebKit/Source/platform/text/TextEncodingDetector.cpp
|
| diff --git a/third_party/WebKit/Source/platform/text/TextEncodingDetector.cpp b/third_party/WebKit/Source/platform/text/TextEncodingDetector.cpp
|
| index d32e81d2f1b970a90f46d191efb891050c237923..7bf6e0c513dbe2997361db54ac1941d70cf7e21d 100644
|
| --- a/third_party/WebKit/Source/platform/text/TextEncodingDetector.cpp
|
| +++ b/third_party/WebKit/Source/platform/text/TextEncodingDetector.cpp
|
| @@ -43,8 +43,12 @@ bool detectTextEncoding(const char* data,
|
| const char* hintUserLanguage,
|
| WTF::TextEncoding* detectedEncoding) {
|
| *detectedEncoding = WTF::TextEncoding();
|
| - Language language;
|
| - LanguageFromCode(hintUserLanguage, &language);
|
| + // In general, do not use language hint. This helps get more
|
| + // deterministic encoding detection results across devices. Note that local
|
| + // file resources can still benefit from the hint.
|
| + Language language = UNKNOWN_LANGUAGE;
|
| + if (hintUrl.protocol() == "file")
|
| + LanguageFromCode(hintUserLanguage, &language);
|
| int consumedBytes;
|
| bool isReliable;
|
| Encoding encoding = CompactEncDet::DetectEncoding(
|
|
|