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

Unified Diff: base/json/json_reader.h

Issue 2475583002: Adds option for JSON reader to allow invalid utf characters (Closed)
Patch Set: comment Created 4 years, 1 month 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 | « base/json/json_parser_unittest.cc ('k') | base/json/json_string_value_serializer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_reader.h
diff --git a/base/json/json_reader.h b/base/json/json_reader.h
index a954821a288d690648457ae4c250a2a45ba0a4b1..a39b37adeb1cbd516ed9e598277ad4dc515cffd9 100644
--- a/base/json/json_reader.h
+++ b/base/json/json_reader.h
@@ -55,6 +55,11 @@ enum JSONParserOptions {
// if the child is Remove()d from root, it would result in use-after-free
// unless it is DeepCopy()ed or this option is used.
JSON_DETACHABLE_CHILDREN = 1 << 1,
+
+ // If set the parser replaces invalid characters with the Unicode replacement
+ // character (U+FFFD). If not set, invalid characters trigger a hard error and
+ // parsing fails.
+ JSON_REPLACE_INVALID_CHARACTERS = 1 << 2,
};
class BASE_EXPORT JSONReader {
« no previous file with comments | « base/json/json_parser_unittest.cc ('k') | base/json/json_string_value_serializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698