| OLD | NEW |
| 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 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com> | 3 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com> |
| 4 * Copyright (C) 2007-2009 Torch Mobile, Inc. | 4 * Copyright (C) 2007-2009 Torch Mobile, Inc. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 : m_name(atomicCanonicalTextEncodingName(name)) | 53 : m_name(atomicCanonicalTextEncodingName(name)) |
| 54 , m_backslashAsCurrencySymbol(backslashAsCurrencySymbol()) | 54 , m_backslashAsCurrencySymbol(backslashAsCurrencySymbol()) |
| 55 { | 55 { |
| 56 } | 56 } |
| 57 | 57 |
| 58 String TextEncoding::decode(const char* data, size_t length, bool stopOnError, b
ool& sawError) const | 58 String TextEncoding::decode(const char* data, size_t length, bool stopOnError, b
ool& sawError) const |
| 59 { | 59 { |
| 60 if (!m_name) | 60 if (!m_name) |
| 61 return String(); | 61 return String(); |
| 62 | 62 |
| 63 return newTextCodec(*this)->decode(data, length, true, stopOnError, sawError
); | 63 return newTextCodec(*this)->decode(data, length, DataEOF, stopOnError, sawEr
ror); |
| 64 } | 64 } |
| 65 | 65 |
| 66 CString TextEncoding::encode(const String& string, UnencodableHandling handling)
const | 66 CString TextEncoding::encode(const String& string, UnencodableHandling handling)
const |
| 67 { | 67 { |
| 68 if (!m_name) | 68 if (!m_name) |
| 69 return CString(); | 69 return CString(); |
| 70 | 70 |
| 71 if (string.isEmpty()) | 71 if (string.isEmpty()) |
| 72 return ""; | 72 return ""; |
| 73 | 73 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 return globalUTF8Encoding; | 216 return globalUTF8Encoding; |
| 217 } | 217 } |
| 218 | 218 |
| 219 const TextEncoding& WindowsLatin1Encoding() | 219 const TextEncoding& WindowsLatin1Encoding() |
| 220 { | 220 { |
| 221 static TextEncoding globalWindowsLatin1Encoding("WinLatin1"); | 221 static TextEncoding globalWindowsLatin1Encoding("WinLatin1"); |
| 222 return globalWindowsLatin1Encoding; | 222 return globalWindowsLatin1Encoding; |
| 223 } | 223 } |
| 224 | 224 |
| 225 } // namespace WTF | 225 } // namespace WTF |
| OLD | NEW |