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

Unified Diff: src/objects.cc

Issue 121173009: String:WriteUtf8: Add REPLACE_INVALID_UTF8 option (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Abandon refactoring, get core behavior change done Created 6 years, 11 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: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index aa7f500c8a36198355b85b37a4ae11484f87a15f..2ff48c5ce1f58c0b294cf09f4bd8c8675eaa5da9 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -8312,8 +8312,10 @@ SmartArrayPointer<char> String::ToCString(AllowNullsFlag allow_nulls,
if (allow_nulls == DISALLOW_NULLS && character == 0) {
character = ' ';
}
- utf8_byte_position +=
- unibrow::Utf8::Encode(result + utf8_byte_position, character, last);
+ utf8_byte_position += unibrow::Utf8::Encode(result + utf8_byte_position,
+ character,
+ last,
+ true);
last = character;
}
result[utf8_byte_position] = 0;

Powered by Google App Engine
This is Rietveld 408576698