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

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

Issue 1407663004: Tweaking WebPageSerializerImpl to emit a BOM for UTF16/32. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased after landing the test files in a separate CL. Created 5 years 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
« no previous file with comments | « third_party/WebKit/Source/web/WebPageSerializerImpl.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007, 2008, 2009 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 String decode(const char* str, size_t length) const 48 String decode(const char* str, size_t length) const
49 { 49 {
50 bool ignored; 50 bool ignored;
51 return decode(str, length, false, ignored); 51 return decode(str, length, false, ignored);
52 } 52 }
53 String decode(const char*, size_t length, bool stopOnError, bool& sawError) const; 53 String decode(const char*, size_t length, bool stopOnError, bool& sawError) const;
54 54
55 CString encode(const String&, UnencodableHandling) const; 55 CString encode(const String&, UnencodableHandling) const;
56 56
57 bool isNonByteBasedEncoding() const;
58
57 private: 59 private:
58 bool isNonByteBasedEncoding() const;
59 bool isUTF7Encoding() const; 60 bool isUTF7Encoding() const;
60 61
61 const char* m_name; 62 const char* m_name;
62 }; 63 };
63 64
64 inline bool operator==(const TextEncoding& a, const TextEncoding& b) { return a. name() == b.name(); } 65 inline bool operator==(const TextEncoding& a, const TextEncoding& b) { return a. name() == b.name(); }
65 inline bool operator!=(const TextEncoding& a, const TextEncoding& b) { return a. name() != b.name(); } 66 inline bool operator!=(const TextEncoding& a, const TextEncoding& b) { return a. name() != b.name(); }
66 67
67 WTF_EXPORT const TextEncoding& ASCIIEncoding(); 68 WTF_EXPORT const TextEncoding& ASCIIEncoding();
68 WTF_EXPORT const TextEncoding& Latin1Encoding(); 69 WTF_EXPORT const TextEncoding& Latin1Encoding();
69 WTF_EXPORT const TextEncoding& UTF16BigEndianEncoding(); 70 WTF_EXPORT const TextEncoding& UTF16BigEndianEncoding();
70 WTF_EXPORT const TextEncoding& UTF16LittleEndianEncoding(); 71 WTF_EXPORT const TextEncoding& UTF16LittleEndianEncoding();
71 WTF_EXPORT const TextEncoding& UTF32BigEndianEncoding(); 72 WTF_EXPORT const TextEncoding& UTF32BigEndianEncoding();
72 WTF_EXPORT const TextEncoding& UTF32LittleEndianEncoding(); 73 WTF_EXPORT const TextEncoding& UTF32LittleEndianEncoding();
73 WTF_EXPORT const TextEncoding& UTF8Encoding(); 74 WTF_EXPORT const TextEncoding& UTF8Encoding();
74 WTF_EXPORT const TextEncoding& WindowsLatin1Encoding(); 75 WTF_EXPORT const TextEncoding& WindowsLatin1Encoding();
75 76
76 } // namespace WTF 77 } // namespace WTF
77 78
78 using WTF::ASCIIEncoding; 79 using WTF::ASCIIEncoding;
79 using WTF::Latin1Encoding; 80 using WTF::Latin1Encoding;
80 using WTF::UTF16BigEndianEncoding; 81 using WTF::UTF16BigEndianEncoding;
81 using WTF::UTF16LittleEndianEncoding; 82 using WTF::UTF16LittleEndianEncoding;
82 using WTF::UTF32BigEndianEncoding; 83 using WTF::UTF32BigEndianEncoding;
83 using WTF::UTF32LittleEndianEncoding; 84 using WTF::UTF32LittleEndianEncoding;
84 using WTF::UTF8Encoding; 85 using WTF::UTF8Encoding;
85 using WTF::WindowsLatin1Encoding; 86 using WTF::WindowsLatin1Encoding;
86 87
87 #endif // TextEncoding_h 88 #endif // TextEncoding_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebPageSerializerImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698