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

Side by Side Diff: third_party/WebKit/Source/wtf/text/UTF8.h

Issue 1888083002: Revert of UTF-8 detector for pages missing encoding info (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 WTF_EXPORT ConversionResult convertUTF16ToUTF8( 64 WTF_EXPORT ConversionResult convertUTF16ToUTF8(
65 const UChar** sourceStart, const UChar* sourceEnd, 65 const UChar** sourceStart, const UChar* sourceEnd,
66 char** targetStart, char* targetEnd, bool strict = true); 66 char** targetStart, char* targetEnd, bool strict = true);
67 67
68 WTF_EXPORT unsigned calculateStringHashAndLengthFromUTF8MaskingTop8Bits(const ch ar* data, const char* dataEnd, unsigned& dataLength, unsigned& utf16Length); 68 WTF_EXPORT unsigned calculateStringHashAndLengthFromUTF8MaskingTop8Bits(const ch ar* data, const char* dataEnd, unsigned& dataLength, unsigned& utf16Length);
69 69
70 WTF_EXPORT bool equalUTF16WithUTF8(const UChar* a, const UChar* aEnd, const char * b, const char* bEnd); 70 WTF_EXPORT bool equalUTF16WithUTF8(const UChar* a, const UChar* aEnd, const char * b, const char* bEnd);
71 WTF_EXPORT bool equalLatin1WithUTF8(const LChar* a, const LChar* aEnd, const cha r* b, const char* bEnd); 71 WTF_EXPORT bool equalLatin1WithUTF8(const LChar* a, const LChar* aEnd, const cha r* b, const char* bEnd);
72 72
73
74 // Given a sequence of bytes in |data| of length |len|, check if the content is
75 // encoded in UTF-8. Pure ASCII text is not regarded as UTF-8 in order to
76 // respect the default encoding since it can be of any encoding.
77 WTF_EXPORT bool isUTF8andNotASCII(const char* data, size_t length);
78
79 } // namespace Unicode 73 } // namespace Unicode
80 } // namespace WTF 74 } // namespace WTF
81 75
82 #endif // WTF_UTF8_h 76 #endif // WTF_UTF8_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/text/TextEncodingDetector.cpp ('k') | third_party/WebKit/Source/wtf/text/UTF8.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698