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

Unified Diff: base/json/string_escape.h

Issue 2903773003: Escape invalid code points (Closed)
Patch Set: Update documentation and signed/unsigned comparison Created 3 years, 7 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 | « no previous file | base/json/string_escape.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/string_escape.h
diff --git a/base/json/string_escape.h b/base/json/string_escape.h
index b66b7e54532e4f195847b8ad817f93e20418be89..c6a5b33e8399f2b36fce3a0c47ea27f5c997205f 100644
--- a/base/json/string_escape.h
+++ b/base/json/string_escape.h
@@ -14,11 +14,12 @@
namespace base {
-// Appends to |dest| an escaped version of |str|. Valid UTF-8 code units will
-// pass through from the input to the output. Invalid code units will be
-// replaced with the U+FFFD replacement character. This function returns true
-// if no replacement was necessary and false if there was a lossy replacement.
-// On return, |dest| will contain a valid UTF-8 JSON string.
+// Appends to |dest| an escaped version of |str|. Valid UTF-8 code units and
+// characters will pass through from the input to the output. Invalid code
+// units and characters will be replaced with the U+FFFD replacement character.
+// This function returns true if no replacement was necessary and false if
+// there was a lossy replacement. On return, |dest| will contain a valid UTF-8
+// JSON string.
//
// Non-printing control characters will be escaped as \uXXXX sequences for
// readability.
« no previous file with comments | « no previous file | base/json/string_escape.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698