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

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

Issue 145973021: Implement "replacement" text encoding. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Replacement codec should emit U+FFFD Created 6 years, 9 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
Index: Source/wtf/text/TextEncodingRegistry.cpp
diff --git a/Source/wtf/text/TextEncodingRegistry.cpp b/Source/wtf/text/TextEncodingRegistry.cpp
index 4dd0240043c598532f930409e545dd1a3848e671..111852dafd74fb2f4ddad6c8ec25aaf7fc4b07de 100644
--- a/Source/wtf/text/TextEncodingRegistry.cpp
+++ b/Source/wtf/text/TextEncodingRegistry.cpp
@@ -38,6 +38,7 @@
#include "wtf/text/CString.h"
#include "wtf/text/TextCodecICU.h"
#include "wtf/text/TextCodecLatin1.h"
+#include "wtf/text/TextCodecReplacement.h"
#include "wtf/text/TextCodecUTF16.h"
#include "wtf/text/TextCodecUTF8.h"
#include "wtf/text/TextCodecUserDefined.h"
@@ -220,6 +221,11 @@ static void buildBaseTextCodecMaps()
TextCodecUserDefined::registerEncodingNames(addToTextEncodingNameMap);
TextCodecUserDefined::registerCodecs(addToTextCodecMap);
+
+ TextCodecReplacement::registerEncodingNames(addToTextEncodingNameMap);
+ TextCodecReplacement::registerCodecs(addToTextCodecMap);
+ // The "replacement" codec should not be referenceable by name.
+ textEncodingNameMap->remove("replacement");
}
static void addEncodingName(HashSet<const char*>* set, const char* name)

Powered by Google App Engine
This is Rietveld 408576698