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

Unified Diff: Source/wtf/text/TextCodecICU.cpp

Issue 27030014: Remove Backslash-as-JPY hack (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: TextCodec/Encoding added 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp ('k') | Source/wtf/text/TextEncoding.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/TextCodecICU.cpp
diff --git a/Source/wtf/text/TextCodecICU.cpp b/Source/wtf/text/TextCodecICU.cpp
index 7458c2acf09a34405c51ed3086124e9717d0f976..7a9014b4ba60f2181d3532d086fcfe165dce36d1 100644
--- a/Source/wtf/text/TextCodecICU.cpp
+++ b/Source/wtf/text/TextCodecICU.cpp
@@ -424,36 +424,21 @@ public:
TextCodecInput(const TextEncoding& encoding, const UChar* characters, size_t length)
: m_begin(characters)
, m_end(characters + length)
- {
- if (encoding.hasTrivialDisplayString())
- return;
- m_buffer.reserveInitialCapacity(length);
- m_buffer.append(characters, length);
- initalizeFromBuffer(encoding);
- }
+ { }
TextCodecInput(const TextEncoding& encoding, const LChar* characters, size_t length)
{
m_buffer.reserveInitialCapacity(length);
for (size_t i = 0; i < length; ++i)
m_buffer.append(characters[i]);
- initalizeFromBuffer(encoding);
+ m_begin = m_buffer.data();
+ m_end = m_begin + m_buffer.size();
}
const UChar* begin() const { return m_begin; }
const UChar* end() const { return m_end; }
private:
- void initalizeFromBuffer(const TextEncoding& encoding)
- {
- // FIXME: We should see if there is "force ASCII range" mode in ICU;
- // until then, we change the backslash into a yen sign.
- // Encoding will change the yen sign back into a backslash.
- encoding.displayBuffer(m_buffer.data(), m_buffer.size());
- m_begin = m_buffer.data();
- m_end = m_begin + m_buffer.size();
- }
-
const UChar* m_begin;
const UChar* m_end;
Vector<UChar> m_buffer;
« no previous file with comments | « Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp ('k') | Source/wtf/text/TextEncoding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698