| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007, 2008 Apple 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 return *this; | 181 return *this; |
| 182 } | 182 } |
| 183 | 183 |
| 184 // HTML5 specifies that UTF-8 be used in form submission when a form is | 184 // HTML5 specifies that UTF-8 be used in form submission when a form is |
| 185 // is a part of a document in UTF-16 probably because UTF-16 is not a | 185 // is a part of a document in UTF-16 probably because UTF-16 is not a |
| 186 // byte-based encoding and can contain 0x00. By extension, the same | 186 // byte-based encoding and can contain 0x00. By extension, the same |
| 187 // should be done for UTF-32. In case of UTF-7, it is a byte-based encoding, | 187 // should be done for UTF-32. In case of UTF-7, it is a byte-based encoding, |
| 188 // but it's fraught with problems and we'd rather steer clear of it. | 188 // but it's fraught with problems and we'd rather steer clear of it. |
| 189 const TextEncoding& TextEncoding::encodingForFormSubmission() const | 189 const TextEncoding& TextEncoding::encodingForFormSubmission() const |
| 190 { | 190 { |
| 191 if (noExtendedTextEncodingNameUsed()) | |
| 192 return *this; | |
| 193 if (isNonByteBasedEncoding() || *this == UTF7Encoding()) | 191 if (isNonByteBasedEncoding() || *this == UTF7Encoding()) |
| 194 return UTF8Encoding(); | 192 return UTF8Encoding(); |
| 195 return *this; | 193 return *this; |
| 196 } | 194 } |
| 197 | 195 |
| 198 const TextEncoding& ASCIIEncoding() | 196 const TextEncoding& ASCIIEncoding() |
| 199 { | 197 { |
| 200 static TextEncoding globalASCIIEncoding("ASCII"); | 198 static TextEncoding globalASCIIEncoding("ASCII"); |
| 201 return globalASCIIEncoding; | 199 return globalASCIIEncoding; |
| 202 } | 200 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 237 |
| 240 const TextEncoding& WindowsLatin1Encoding() | 238 const TextEncoding& WindowsLatin1Encoding() |
| 241 { | 239 { |
| 242 static TextEncoding globalWindowsLatin1Encoding("WinLatin-1"); | 240 static TextEncoding globalWindowsLatin1Encoding("WinLatin-1"); |
| 243 return globalWindowsLatin1Encoding; | 241 return globalWindowsLatin1Encoding; |
| 244 } | 242 } |
| 245 | 243 |
| 246 } // namespace WebCore | 244 } // namespace WebCore |
| 247 | 245 |
| 248 | 246 |
| OLD | NEW |