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

Side by Side Diff: Source/wtf/text/TextEncoding.cpp

Issue 25870005: Canonical name change: windows-949 => EUC-KR (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update legacy-encode result and cl description Created 7 years, 2 months 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 | « Source/wtf/text/TextEncoding.h ('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 * 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } 113 }
114 ASSERT(U_SUCCESS(err)); 114 ASSERT(U_SUCCESS(err));
115 115
116 source = normalizedCharacters.data(); 116 source = normalizedCharacters.data();
117 length = normalizedLength; 117 length = normalizedLength;
118 } 118 }
119 119
120 return newTextCodec(*this)->encode(source, length, handling); 120 return newTextCodec(*this)->encode(source, length, handling);
121 } 121 }
122 122
123 const char* TextEncoding::domName() const
124 {
125 if (noExtendedTextEncodingNameUsed())
126 return m_name;
127
128 // We treat EUC-KR as windows-949 (its superset), but need to expose
129 // the name 'EUC-KR' because the name 'windows-949' is not recognized by
130 // most Korean web servers even though they do use the encoding
131 // 'windows-949' with the name 'EUC-KR'.
132 // FIXME: This is not thread-safe. At the moment, this function is
133 // only accessed in a single thread, but eventually has to be made
134 // thread-safe along with usesVisualOrdering().
135 static const char* const a = atomicCanonicalTextEncodingName("windows-949");
136 if (m_name == a)
137 return "EUC-KR";
138 return m_name;
139 }
140
141 bool TextEncoding::usesVisualOrdering() const 123 bool TextEncoding::usesVisualOrdering() const
142 { 124 {
143 if (noExtendedTextEncodingNameUsed()) 125 if (noExtendedTextEncodingNameUsed())
144 return false; 126 return false;
145 127
146 static const char* const a = atomicCanonicalTextEncodingName("ISO-8859-8"); 128 static const char* const a = atomicCanonicalTextEncodingName("ISO-8859-8");
147 return m_name == a; 129 return m_name == a;
148 } 130 }
149 131
150 bool TextEncoding::isJapanese() const 132 bool TextEncoding::isJapanese() const
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 return globalUTF8Encoding; 222 return globalUTF8Encoding;
241 } 223 }
242 224
243 const TextEncoding& WindowsLatin1Encoding() 225 const TextEncoding& WindowsLatin1Encoding()
244 { 226 {
245 static TextEncoding globalWindowsLatin1Encoding("WinLatin1"); 227 static TextEncoding globalWindowsLatin1Encoding("WinLatin1");
246 return globalWindowsLatin1Encoding; 228 return globalWindowsLatin1Encoding;
247 } 229 }
248 230
249 } // namespace WTF 231 } // namespace WTF
OLDNEW
« no previous file with comments | « Source/wtf/text/TextEncoding.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698