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

Side by Side Diff: third_party/WebKit/Source/wtf/text/TextCodec.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: Saving UTF16 with BOM. Leaving UTF32 in a broken state. 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com> 3 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 String decode(const char* str, size_t length, FlushBehavior flush = DoNotFlu sh) 80 String decode(const char* str, size_t length, FlushBehavior flush = DoNotFlu sh)
81 { 81 {
82 bool ignored; 82 bool ignored;
83 return decode(str, length, flush, false, ignored); 83 return decode(str, length, flush, false, ignored);
84 } 84 }
85 85
86 virtual String decode(const char*, size_t length, FlushBehavior, bool stopOn Error, bool& sawError) = 0; 86 virtual String decode(const char*, size_t length, FlushBehavior, bool stopOn Error, bool& sawError) = 0;
87 virtual CString encode(const UChar*, size_t length, UnencodableHandling) = 0 ; 87 virtual CString encode(const UChar*, size_t length, UnencodableHandling) = 0 ;
88 virtual CString encode(const LChar*, size_t length, UnencodableHandling) = 0 ; 88 virtual CString encode(const LChar*, size_t length, UnencodableHandling) = 0 ;
89 virtual bool shouldIncludeBOM();
89 90
90 // Fills a null-terminated string representation of the given 91 // Fills a null-terminated string representation of the given
91 // unencodable character into the given replacement buffer. 92 // unencodable character into the given replacement buffer.
92 // The length of the string (not including the null) will be returned. 93 // The length of the string (not including the null) will be returned.
93 static int getUnencodableReplacement(unsigned codePoint, UnencodableHandling , UnencodableReplacementArray); 94 static int getUnencodableReplacement(unsigned codePoint, UnencodableHandling , UnencodableReplacementArray);
94 }; 95 };
95 96
96 typedef void (*EncodingNameRegistrar)(const char* alias, const char* name); 97 typedef void (*EncodingNameRegistrar)(const char* alias, const char* name);
97 98
98 typedef PassOwnPtr<TextCodec> (*NewTextCodecFunction)(const TextEncoding&, const void* additionalData); 99 typedef PassOwnPtr<TextCodec> (*NewTextCodecFunction)(const TextEncoding&, const void* additionalData);
99 typedef void (*TextCodecRegistrar)(const char* name, NewTextCodecFunction, const void* additionalData); 100 typedef void (*TextCodecRegistrar)(const char* name, NewTextCodecFunction, const void* additionalData);
100 101
101 } // namespace WTF 102 } // namespace WTF
102 103
103 using WTF::TextCodec; 104 using WTF::TextCodec;
104 105
105 #endif // TextCodec_h 106 #endif // TextCodec_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698