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

Unified Diff: json/string_escape.cc

Issue 2050803003: Update to Chromium //base at Chromium commit e3a753f17bac62738b0dbf0b36510f767b081e4b. (Closed) Base URL: https://github.com/domokit/base.git@master
Patch Set: Created 4 years, 6 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 | « feature_list_unittest.cc ('k') | json/string_escape_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: json/string_escape.cc
diff --git a/json/string_escape.cc b/json/string_escape.cc
index 469f9f98c038e1ec027fcf23203289ea4c67af88..f5d6a760218377384e4412fea2f2ab89fc6b5424 100644
--- a/json/string_escape.cc
+++ b/json/string_escape.cc
@@ -59,6 +59,14 @@ bool EscapeSpecialCodePoint(uint32 code_point, std::string* dest) {
case '<':
dest->append("\\u003C");
break;
+ // Escape the "Line Separator" and "Paragraph Separator" characters, since
+ // they should be treated like a new line \r or \n.
+ case 0x2028:
+ dest->append("\\u2028");
+ break;
+ case 0x2029:
+ dest->append("\\u2029");
+ break;
default:
return false;
}
« no previous file with comments | « feature_list_unittest.cc ('k') | json/string_escape_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698