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

Side by Side Diff: third_party/WebKit/WebCore/platform/text/TextEncoding.cpp

Issue 440032: Disable the replacement of U+005C (backslash) with Yen sign in documents enco... (Closed) Base URL: svn://chrome-svn/chrome/branches/249/src/
Patch Set: Created 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 * 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 addEncodingName(set, "ISO-2022-JP-1"); 183 addEncodingName(set, "ISO-2022-JP-1");
184 addEncodingName(set, "ISO-2022-JP-3"); 184 addEncodingName(set, "ISO-2022-JP-3");
185 addEncodingName(set, "EUC-JP"); 185 addEncodingName(set, "EUC-JP");
186 addEncodingName(set, "Shift_JIS"); 186 addEncodingName(set, "Shift_JIS");
187 } 187 }
188 return m_name && set.contains(m_name); 188 return m_name && set.contains(m_name);
189 } 189 }
190 190
191 UChar TextEncoding::backslashAsCurrencySymbol() const 191 UChar TextEncoding::backslashAsCurrencySymbol() const
192 { 192 {
193 #if PLATFORM(CHROMIUM)
194 // Chromium does not want this. The blog article cited is not
195 // a justification for replacing U+005C with U+00A5.
196 return '\\';
197 #else
193 if (noExtendedTextEncodingNameUsed()) 198 if (noExtendedTextEncodingNameUsed())
194 return '\\'; 199 return '\\';
195 200
196 // The text encodings below treat backslash as a currency symbol. 201 // The text encodings below treat backslash as a currency symbol.
197 // See http://blogs.msdn.com/michkap/archive/2005/09/17/469941.aspx for more information. 202 // See http://blogs.msdn.com/michkap/archive/2005/09/17/469941.aspx for more information.
198 static const char* const a = atomicCanonicalTextEncodingName("Shift_JIS_X021 3-2000"); 203 static const char* const a = atomicCanonicalTextEncodingName("Shift_JIS_X021 3-2000");
199 static const char* const b = atomicCanonicalTextEncodingName("EUC-JP"); 204 static const char* const b = atomicCanonicalTextEncodingName("EUC-JP");
200 return (m_name == a || m_name == b) ? 0x00A5 : '\\'; 205 return (m_name == a || m_name == b) ? 0x00A5 : '\\';
206 #endif
201 } 207 }
202 208
203 bool TextEncoding::isNonByteBasedEncoding() const 209 bool TextEncoding::isNonByteBasedEncoding() const
204 { 210 {
205 if (noExtendedTextEncodingNameUsed()) { 211 if (noExtendedTextEncodingNameUsed()) {
206 return *this == UTF16LittleEndianEncoding() 212 return *this == UTF16LittleEndianEncoding()
207 || *this == UTF16BigEndianEncoding(); 213 || *this == UTF16BigEndianEncoding();
208 } 214 }
209 215
210 return *this == UTF16LittleEndianEncoding() 216 return *this == UTF16LittleEndianEncoding()
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 return globalUTF8Encoding; 289 return globalUTF8Encoding;
284 } 290 }
285 291
286 const TextEncoding& WindowsLatin1Encoding() 292 const TextEncoding& WindowsLatin1Encoding()
287 { 293 {
288 static TextEncoding globalWindowsLatin1Encoding("WinLatin-1"); 294 static TextEncoding globalWindowsLatin1Encoding("WinLatin-1");
289 return globalWindowsLatin1Encoding; 295 return globalWindowsLatin1Encoding;
290 } 296 }
291 297
292 } // namespace WebCore 298 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698